diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-28 17:51:05 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-28 17:51:13 +0300 |
commit | c65f4b3d76deb47017a2e661290481e5e613b5db (patch) | |
tree | 4723d44c0f7ee6e23c78126409dc223c85eb920d /source/blender/draw | |
parent | 11e32332ddfdcacb7f992d9fb25025b53c5037c1 (diff) |
DrawManager: Early return for buffer cache creation
No real functional changes.
This is useful for benchmark cases when `cache->uv_cage` is passed but
has no buffers are requested.
Diffstat (limited to 'source/blender/draw')
-rw-r--r-- | source/blender/draw/intern/draw_cache_extract_mesh.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index f167ea3d540..fe162e6ea6d 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -5956,12 +5956,14 @@ void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph, eMRDataType data_flag = 0; const bool do_lines_loose_subbuffer = mbc.ibo.lines_loose != NULL; + bool do_extract = false; #define TEST_ASSIGN(type, type_lowercase, name) \ do { \ if (DRW_TEST_ASSIGN_##type(mbc.type_lowercase.name)) { \ iter_flag |= mesh_extract_iter_type(&extract_##name); \ data_flag |= extract_##name.data_flag; \ + do_extract = true; \ } \ } while (0) @@ -6000,6 +6002,10 @@ void mesh_buffer_cache_create_requested(struct TaskGraph *task_graph, TEST_ASSIGN(IBO, ibo, edituv_points); TEST_ASSIGN(IBO, ibo, edituv_fdots); + if (!do_extract) { + return; + } + if (do_lines_loose_subbuffer) { iter_flag |= MR_ITER_LEDGE; } |