Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-16 09:31:12 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-01-16 09:31:26 +0300
commit3574f2730d2a42cda2881d26209b8dc53b1d2047 (patch)
treedfd1aa439249d44ce10de737aea5259db70781c8 /source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
parentb87d87b1d3c8400e4ee4ea3f0763df64c8ca7fc0 (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/mesh_extractors/extract_mesh_vbo_edituv_data.cc')
-rw-r--r--source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
index 067d482bc2b..b1866708d14 100644
--- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
+++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edituv_data.cc
@@ -141,14 +141,17 @@ static void extract_edituv_data_init_subdiv(const DRWSubdivCache *subdiv_cache,
static void extract_edituv_data_iter_subdiv(const DRWSubdivCache *subdiv_cache,
const MeshRenderData *mr,
- void *_data)
+ void *_data,
+ uint subdiv_quad_index)
{
MeshExtract_EditUVData_Data *data = static_cast<MeshExtract_EditUVData_Data *>(_data);
int *subdiv_loop_vert_index = (int *)GPU_vertbuf_get_data(subdiv_cache->verts_orig_index);
int *subdiv_loop_edge_index = (int *)GPU_vertbuf_get_data(subdiv_cache->edges_orig_index);
int *subdiv_loop_poly_index = subdiv_cache->subdiv_loop_poly_index;
- for (uint i = 0; i < subdiv_cache->num_subdiv_loops; i++) {
+ uint start_loop_idx = subdiv_quad_index * 4;
+ uint end_loop_idx = (subdiv_quad_index + 1) * 4;
+ for (uint i = start_loop_idx; i < end_loop_idx; i++) {
const int vert_origindex = subdiv_loop_vert_index[i];
const int edge_origindex = subdiv_loop_edge_index[i];
const int poly_origindex = subdiv_loop_poly_index[i];