From d5e4cab76c625c45b73868cf27021de1fada2830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Tue, 8 Mar 2022 13:27:54 +0100 Subject: 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 --- source/blender/draw/intern/draw_cache_extract_mesh.cc | 1 + 1 file changed, 1 insertion(+) (limited to 'source/blender/draw') 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); -- cgit v1.2.3