diff options
author | Jeroen Bakker <jbakker> | 2021-06-09 17:20:38 +0300 |
---|---|---|
committer | Jeroen Bakker <jeroen@blender.org> | 2021-06-09 17:20:53 +0300 |
commit | 6e999e08ab87712a9baca33ab691af2b83762b7e (patch) | |
tree | 3c747c277bd7090b87f5300986dcec782a7bb9ec /source/blender/draw/intern/draw_cache_extract.h | |
parent | ec98bb318b938f829859ee7dfa1a96d1171c2a64 (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.h')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract.h | 2 |
1 files changed, 1 insertions, 1 deletions
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) { |