diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/draw/intern/DRW_render.h | 1 | ||||
-rw-r--r-- | source/blender/draw/intern/draw_manager.c | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/draw/intern/DRW_render.h b/source/blender/draw/intern/DRW_render.h index 88d40f565c5..dddc6fb4aec 100644 --- a/source/blender/draw/intern/DRW_render.h +++ b/source/blender/draw/intern/DRW_render.h @@ -428,6 +428,7 @@ void DRW_render_instance_buffer_finish(void); /* ViewLayers */ void *DRW_view_layer_engine_data_get(DrawEngineType *engine_type); +void **DRW_view_layer_engine_data_ensure_ex(struct ViewLayer *view_layer, DrawEngineType *engine_type, void (*callback)(void *storage)); void **DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void (*callback)(void *storage)); /* Objects */ diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index 6b37c661bbf..25c1940627b 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -680,11 +680,11 @@ void *DRW_view_layer_engine_data_get(DrawEngineType *engine_type) return NULL; } -void **DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void (*callback)(void *storage)) +void **DRW_view_layer_engine_data_ensure_ex(ViewLayer *view_layer, DrawEngineType *engine_type, void (*callback)(void *storage)) { ViewLayerEngineData *sled; - for (sled = DST.draw_ctx.view_layer->drawdata.first; sled; sled = sled->next) { + for (sled = view_layer->drawdata.first; sled; sled = sled->next) { if (sled->engine_type == engine_type) { return &sled->storage; } @@ -693,11 +693,16 @@ void **DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void (*cal sled = MEM_callocN(sizeof(ViewLayerEngineData), "ViewLayerEngineData"); sled->engine_type = engine_type; sled->free = callback; - BLI_addtail(&DST.draw_ctx.view_layer->drawdata, sled); + BLI_addtail(&view_layer->drawdata, sled); return &sled->storage; } +void **DRW_view_layer_engine_data_ensure(DrawEngineType *engine_type, void (*callback)(void *storage)) +{ + return DRW_view_layer_engine_data_ensure_ex(DST.draw_ctx.view_layer, engine_type, callback); +} + /** \} */ |