Fix T99103: crash when displaying or rendering Grease Pencil object

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.

So use `floatBitsToUint` for type conversion.

Differential Revision: https://developer.blender.org/D15433
This commit is contained in:
Khoi Dau
2022-07-12 11:30:41 -03:00
committed by Germano Cavalcante
parent d58072caf4
commit 93253d5dcc

View File

@@ -32,7 +32,7 @@ void main()
vec3 vert_N;
gpMaterial gp_mat = materials[ma1.x + gpMaterialOffset];
gpMaterialFlag gp_flag = floatBitsToInt(gp_mat._flag);
gpMaterialFlag gp_flag = floatBitsToUint(gp_mat._flag);
gl_Position = gpencil_vertex(ma,
ma1,