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.
This commit is contained in:
Germano Cavalcante 2021-05-28 11:51:05 -03:00
parent 11e32332dd
commit c65f4b3d76
Notes: blender-bot 2023-02-14 10:04:50 +01:00
Referenced by issue #88859, Assert when changing view modes
1 changed files with 6 additions and 0 deletions

View File

@ -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;
}