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:
authorGermano Cavalcante <mano-wii>2021-07-20 17:43:38 +0300
committerGermano Cavalcante <germano.costa@ig.com.br>2021-07-21 21:09:43 +0300
commit178086d5810a0de9e1d95c7fbd6c443cd53af40d (patch)
tree690553abc005e71ebca93322c82efb42072df77d /source/blender/draw/intern/draw_cache_extract.h
parent785d87ee42aa1bb09c6ab3282b9fd602f9c14d62 (diff)
Draw Cache: extract tris in parallel ranges
The `ibo.tris` extraction in multithread is currently only done if the mesh has only 1 material. Now we cache a map indicating the index of each polygon after sort and thus allow the extraction of tris with materials in multithreaded. As caching is a heavy operation and was already being performed in multi-thread for triangle offsets, no significant improvements are expected. The benefit will be much greater when we can skip updating the cache while transforming a geometry. **Profiling:** ||master:|PATCH: |---|---|---| |large_mesh_editing_materials:|Average: 13.855380 FPS|Average: 15.525684 FPS ||rdata 9ms iter 36ms (frame 71ms)|rdata 9ms iter 29ms (frame 64ms) |subdiv_mesh_final_only_materials:|Average: 28.113742 FPS|Average: 28.633599 FPS ||rdata 0ms iter 1ms (frame 36ms)|rdata 0ms iter 1ms (frame 35ms) 1.1x overall speedup Differential Revision: https://developer.blender.org/D11445
Diffstat (limited to 'source/blender/draw/intern/draw_cache_extract.h')
-rw-r--r--source/blender/draw/intern/draw_cache_extract.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract.h b/source/blender/draw/intern/draw_cache_extract.h
index f2f769534ca..7dc468d1a73 100644
--- a/source/blender/draw/intern/draw_cache_extract.h
+++ b/source/blender/draw/intern/draw_cache_extract.h
@@ -84,9 +84,9 @@ typedef enum eMRDataType {
MR_DATA_LOOSE_GEOM = 1 << 4,
/** Force loop normals calculation. */
MR_DATA_TAN_LOOP_NOR = 1 << 5,
- MR_DATA_MAT_OFFSETS = 1 << 6,
+ MR_DATA_POLYS_SORTED = 1 << 6,
} eMRDataType;
-ENUM_OPERATORS(eMRDataType, MR_DATA_MAT_OFFSETS)
+ENUM_OPERATORS(eMRDataType, MR_DATA_POLYS_SORTED)
#ifdef __cplusplus
extern "C" {
@@ -170,10 +170,10 @@ typedef struct MeshBufferExtractionCache {
} loose_geom;
struct {
- int *tri;
+ int *tri_first_index;
+ int *mat_tri_len;
int visible_tri_len;
- } mat_offsets;
-
+ } poly_sorted;
} MeshBufferExtractionCache;
#define FOREACH_MESH_BUFFER_CACHE(batch_cache, mbc) \