Page MenuHome

Fix potential crashing when displaying or rendering Grease Pencil object on older hardware
ClosedPublic

Authored by Khoi Dau (khoidauminh) on Jul 12 2022, 3:56 PM.

Details

Summary

This is my first time submitting a patch.

The bug has been addressed in T99103.

On some hardware/systems, blender may crash when adding, rendering or displaying Grease Pencil objects.

In /source/blender/draw/engines/gpencil/shaders/gpencil_vert.glsl, line 35:

gpMaterialFlag gp_flag = floatBitsToInt(gp_mat._flag);

gpMaterialFlag is of type uint. This is a mismatched-type assignment that can cause crashes on some hardware/systems with GLSL that do not support implicit type casting.

The function can be wrapped in the unit constructor to explicitly convert the return type.

Update: using floatBitsToUint for type conversion.

Diff Detail

Repository
rB Blender

Event Timeline

Khoi Dau (khoidauminh) requested review of this revision.Jul 12 2022, 3:56 PM
Khoi Dau (khoidauminh) created this revision.

Could we use floatBitsToUint instead?

Definitely floatBitsToUint. I tried using the function but made a typo in the name and thought it was unavailable.

Khoi Dau (khoidauminh) edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Jul 12 2022, 4:34 PM