From fa7e4cc685d4f2af50a36ce8c5bc61d1dd918bae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Mon, 26 Feb 2018 19:49:06 +0100 Subject: WM/GPU: Clear VAO cache of batch preset when switching context. This is needed for multiple windows to draw the batch presets. This will not be needed once we use only one context for UI. --- source/blender/windowmanager/intern/wm_window.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 278a70b9c9d..018318556e8 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -79,6 +79,7 @@ #include "PIL_time.h" +#include "GPU_batch.h" #include "GPU_draw.h" #include "GPU_extensions.h" #include "GPU_init_exit.h" @@ -381,6 +382,7 @@ void wm_window_close(bContext *C, wmWindowManager *wm, wmWindow *win) } if (tmpwin) { + gpu_batch_presets_reset(); immDeactivate(); } @@ -501,7 +503,7 @@ static void wm_window_ghostwindow_add(wmWindowManager *wm, const char *title, wm #endif GHOST_kDrawingContextTypeOpenGL, glSettings); - + if (ghostwin) { GHOST_RectangleHandle bounds; @@ -1028,6 +1030,7 @@ void wm_window_make_drawable(wmWindowManager *wm, wmWindow *win) printf("%s: set drawable %d\n", __func__, win->winid); } + gpu_batch_presets_reset(); immDeactivate(); GHOST_ActivateWindowDrawingContext(win->ghostwin); GWN_context_active_set(win->gwnctx); -- cgit v1.2.3