diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-16 09:31:12 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2022-01-16 09:31:26 +0300 |
commit | 3574f2730d2a42cda2881d26209b8dc53b1d2047 (patch) | |
tree | dfd1aa439249d44ce10de737aea5259db70781c8 /source/blender/draw/intern/draw_cache_extract_mesh.cc | |
parent | b87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0 (diff) |
Cleanup: deduplicate GPU subdiv data extraction loops
This puts the loop over the final subdivision quads outside of the mesh
iteration callback. This can also allow for easier parallel execution in
the future if need be.
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.cc')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc index eed015bc212..117ce2a2817 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.cc +++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc @@ -861,7 +861,9 @@ static void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache *cache, extractor->init_subdiv(subdiv_cache, &mr, cache, buffer, data); if (extractor->iter_subdiv) { - extractor->iter_subdiv(subdiv_cache, &mr, data); + for (uint i = 0; i < subdiv_cache->num_subdiv_quads; i++) { + extractor->iter_subdiv(subdiv_cache, &mr, data, i); + } } if (extractor->iter_loose_geom_subdiv) { |