diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-03-08 15:27:54 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-03-08 15:47:14 +0300 |
commit | d5e4cab76c625c45b73868cf27021de1fada2830 (patch) | |
tree | 0b72d5ef1bd4cdb68f994087c2b16d262ef85d2b /source | |
parent | 3a672fe6fbdc22123b4c6342c5ac44ecf189eacb (diff) |
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
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc index fb791916b46..c36a8ca5e2b 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.cc +++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc @@ -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); |