From 6e999e08ab87712a9baca33ab691af2b83762b7e Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Wed, 9 Jun 2021 16:20:38 +0200 Subject: 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 --- source/blender/draw/intern/draw_cache_extract.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/draw/intern/draw_cache_extract.h') diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h index 0b6dffa9073..304cae1d2dc 100644 --- a/source/blender/draw/intern/draw_cache_extract.h +++ b/source/blender/draw/intern/draw_cache_extract.h @@ -90,7 +90,7 @@ ENUM_OPERATORS(eMRDataType, MR_DATA_TAN_LOOP_NOR) extern "C" { #endif -BLI_INLINE int mesh_render_mat_len_get(Mesh *me) +BLI_INLINE int mesh_render_mat_len_get(const Mesh *me) { /* In edit mode, the displayed mesh is stored in the edit-mesh. */ if (me->edit_mesh && me->edit_mesh->mesh_eval_final) { -- cgit v1.2.3