From fc0f6d19adae47cfb2d0abd31f4b44395179cb89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dietrich?= Date: Wed, 4 May 2022 19:31:53 +0200 Subject: Fix T96845: artifacts with GPU subdivision and mirror modifier The coarse polygon count was set to the one of the BMesh instead of the the one of the mesh used for subdivision, which caused the compute shaders to output wrong data. --- source/blender/draw/intern/draw_cache_impl_subdivision.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index 19745304b2d..7d245f4158b 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -1143,7 +1143,7 @@ static void draw_subdiv_init_ubo_storage(const DRWSubdivCache *cache, ubo->max_patch_face = cache->gpu_patch_map.max_patch_face; ubo->max_depth = cache->gpu_patch_map.max_depth; ubo->patches_are_triangular = cache->gpu_patch_map.patches_are_triangular; - ubo->coarse_poly_count = cache->bm ? cache->bm->totface : cache->num_coarse_poly; + ubo->coarse_poly_count = cache->num_coarse_poly; ubo->optimal_display = cache->optimal_display; ubo->num_subdiv_loops = cache->num_subdiv_loops; ubo->edge_loose_offset = cache->num_subdiv_loops * 2; -- cgit v1.2.3