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:
authorJeroen Bakker <jbakker>2021-06-09 17:20:38 +0300
committerJeroen Bakker <jeroen@blender.org>2021-06-09 17:20:53 +0300
commit6e999e08ab87712a9baca33ab691af2b83762b7e (patch)
tree3c747c277bd7090b87f5300986dcec782a7bb9ec /source/blender/draw/intern/draw_cache_extract_mesh.cc
parentec98bb318b938f829859ee7dfa1a96d1171c2a64 (diff)
T88352: Use threaded ibo.tris extraction for single material meshes.
This patch adds a specific extraction method when the mesh has only one material. This method is multi-threaded. There is a trade-off in this patch as the ibo isn't compressed (it adds restart indexes for hidden faces). So it depends if threading is faster than the additional GPU buffer upload. # Subdivided cube I used a cube subdivided 7 times, modifiers applied. that gives around 400000 faces. The test is selecting some vertices and move them. During this test the next buffers are updated on each frame: * vbo.pos_nor * vbo.lnor * vbo.edit_data * ibo.tris * ibo.points System info: |platform| Linux-5.11.0-7614-generic-x86_64-with-glibc2.33| | renderer| AMD SIENNA_CICHLID (DRM 3.40.0, 5.11.0-7614-generic, LLVM 11.0.1)| |vendor| AMD| |version| 4.6 (Core Profile) Mesa 21.0.1| |cpu| Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz| |compiler| gcc version 10.3.0| Timing have been measured using DEBUG_TIME in `draw_cache_extract_mesh`. master: `rdata 8ms iter 45ms (frame 153ms)` this patch `rdata 6ms iter 36ms (frame 132ms)` Reviewed By: mano-wii Maniphest Tasks: T88352 Differential Revision: https://developer.blender.org/D11290
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract_mesh.cc')
-rw-r--r--source/blender/draw/intern/draw_cache_extract_mesh.cc4
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 7b2c0da4dd9..6b5877e6759 100644
--- a/source/blender/draw/intern/draw_cache_extract_mesh.cc
+++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc
@@ -866,6 +866,7 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
*/
const bool do_hq_normals = (scene->r.perf_flag & SCE_PERF_HQ_NORMALS) != 0 ||
GPU_use_hq_normals_workaround();
+ const bool override_single_mat = mesh_render_mat_len_get(me) <= 1;
/* Create an array containing all the extractors that needs to be executed. */
ExtractorRunDatas extractors;
@@ -873,7 +874,8 @@ static void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph,
#define EXTRACT_ADD_REQUESTED(type, type_lowercase, name) \
do { \
if (DRW_##type_lowercase##_requested(mbc->type_lowercase.name)) { \
- const MeshExtract *extractor = mesh_extract_override_get(&extract_##name, do_hq_normals); \
+ const MeshExtract *extractor = mesh_extract_override_get( \
+ &extract_##name, do_hq_normals, override_single_mat); \
extractors.append(extractor); \
} \
} while (0)