From 2d94b0d6b062ecdaa1fb8553073cc4d80699ea0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 9 Oct 2020 17:00:00 +0200 Subject: GPU: Add more safeguard for BGL calls This makes sure no BGL call before window drawing locks the GPUState. --- source/blender/windowmanager/intern/wm_draw.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'source/blender/windowmanager') diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 2853481381d..a805e00e0a2 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -863,6 +863,10 @@ static void wm_draw_window(bContext *C, wmWindow *win) { bScreen *screen = WM_window_get_active_screen(win); bool stereo = WM_stereo3d_enabled(win, false); + + /* Avoid any BGL call issued before this to alter the window drawin. */ + GPU_bgl_end(); + /* Draw area regions into their own framebuffer. This way we can redraw * the areas that need it, and blit the rest from existing framebuffers. */ wm_draw_window_offscreen(C, win, stereo); -- cgit v1.2.3