Page MenuHome

GPU: Fix UBSan commit for eGPUSamplerState
ClosedPublic

Authored by Ankit Meel (ankitm) on Oct 8 2020, 10:34 PM.

Details

Summary

The real maximum was GPU_SAMPLER_ICON, not GPU_SAMPLER_REPEAT, my
bad. rBa31a87f8943a: T81340: UBSan: load of value .. not valid for GPU enum type

Move GPU_SAMPLER_MAX out of the enum since it's used as an int
at many places.
Also, the macro ENUM_OPERATORS needs a maximum, and this enumerator
cannot be used as the argument of that macro. It creates wrong values
after ~ operator.

Diff Detail

Repository
rB Blender

Event Timeline

Ankit Meel (ankitm) requested review of this revision.Oct 8 2020, 10:34 PM
Clément Foucault (fclem) requested changes to this revision.Oct 9 2020, 12:42 PM
Clément Foucault (fclem) added inline comments.
source/blender/gpu/GPU_texture.h
63–67

put a comment explaining why it's out of the enum.

This revision now requires changes to proceed.Oct 9 2020, 12:42 PM
Ankit Meel (ankitm) marked an inline comment as done.Oct 9 2020, 12:58 PM
This revision is now accepted and ready to land.Oct 9 2020, 1:59 PM
This revision was automatically updated to reflect the committed changes.