diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-26 15:51:44 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-05-26 15:52:45 +0300 |
commit | 55e3930b253e4c6687ff94b474cc9973e0c00520 (patch) | |
tree | e42fb398ce0540134e2b02c9ba0abc1b052ceef4 /source/blender/draw/intern/shaders | |
parent | 38a2576acef020566497f1d0c8c2c492de74b769 (diff) |
Fix T98392: GPU subdivision crash with knife tools
The face dots normals may not be always requested, thus leading to a
crash by null pointer dereference.
Diffstat (limited to 'source/blender/draw/intern/shaders')
-rw-r--r-- | source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl index e8d98428a8d..e842a73b8b3 100644 --- a/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl +++ b/source/blender/draw/intern/shaders/common_subdiv_patch_evaluation_comp.glsl @@ -70,10 +70,12 @@ layout(std430, binding = 8) writeonly buffer outputVertices FDotVert output_verts[]; }; +# ifdef FDOTS_NORMALS layout(std430, binding = 9) writeonly buffer outputNormals { FDotNor output_nors[]; }; +# endif layout(std430, binding = 10) writeonly buffer outputFdotsIndices { @@ -375,13 +377,15 @@ void main() fnor.flag = get_face_flag(coarse_quad_index); output_verts[coarse_quad_index] = vert; +# ifdef FDOTS_NORMALS output_nors[coarse_quad_index] = fnor; +# endif if (is_face_hidden(coarse_quad_index)) { - output_indices[coarse_quad_index] = 0xffffffff; + output_indices[coarse_quad_index] = 0xffffffff; } else { - output_indices[coarse_quad_index] = coarse_quad_index; + output_indices[coarse_quad_index] = coarse_quad_index; } } #else |