Fix T96224: GPU subdiv crash with smooth normals and tangents

Tangents are computed from UVs on the CPU side when using GPU subdivision
and require that the normals are available there as well (at least for smooth
shading, flat normals can be computed on the fly). This simply adds the missing
normals update call for the `MeshRenderData` setup for the subdivision case.

Differential Revision: https://developer.blender.org/D14278
This commit is contained in:
Kévin Dietrich 2022-03-08 13:27:54 +01:00
parent 3a672fe6fb
commit d5e4cab76c
Notes: blender-bot 2023-02-14 01:07:44 +01:00
Referenced by issue #96224, Tangent shader node & subdivision surface crashes blender
1 changed files with 1 additions and 0 deletions

View File

@ -870,6 +870,7 @@ static void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache *cache,
}
mesh_render_data_update_looptris(mr, MR_ITER_LOOPTRI, MR_DATA_LOOPTRI);
mesh_render_data_update_normals(mr, MR_DATA_TAN_LOOP_NOR);
mesh_render_data_update_loose_geom(mr, mbc, MR_ITER_LEDGE | MR_ITER_LVERT, MR_DATA_LOOSE_GEOM);
DRW_subdivide_loose_geom(subdiv_cache, mbc);