From c77870fc78f594411c9831ee77eba2167a702fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sat, 31 Mar 2018 19:32:28 +0200 Subject: UI: Perf: Batch icons drawcalls together. For this we use a new shader that gets it's data from a uniform array. Vertex shader position the vertices using these data. Using glUniform is way faster than using imm for that matter. Like BLF rendering, UI icons are always (as far as I know) non occluded and displayed above everything else. They also does not overlap with texts so they can be batched at the same time. --- source/blender/editors/interface/interface.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/editors/interface/interface.c') diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 0050340d842..0c786874180 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -64,6 +64,7 @@ #include "BLT_translation.h" #include "UI_interface.h" +#include "UI_interface_icons.h" #include "IMB_imbuf.h" @@ -1427,6 +1428,7 @@ void UI_block_draw(const bContext *C, uiBlock *block) ui_draw_aligned_panel(&style, block, &rect, UI_panel_category_is_visible(ar)); BLF_batch_draw_begin(); + UI_icon_draw_cache_begin(); /* widgets */ for (but = block->buttons.first; but; but = but->next) { @@ -1440,6 +1442,7 @@ void UI_block_draw(const bContext *C, uiBlock *block) } } + UI_icon_draw_cache_end(); BLF_batch_draw_end(); /* restore matrix */ -- cgit v1.2.3