[Bf-blender-cvs] [6ba70d5996a] blender2.8: Fix crash when rendering viewport within another area

Clément Foucault noreply at git.blender.org
Tue Jul 31 18:29:39 CEST 2018


Commit: 6ba70d5996a4fdb82516d199dacfee066f2b3bfc
Author: Clément Foucault
Date:   Tue Jul 31 18:20:57 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB6ba70d5996a4fdb82516d199dacfee066f2b3bfc

Fix crash when rendering viewport within another area

This also Fix T55574 Crash on sequencer preview

===================================================================

M	source/blender/editors/space_view3d/view3d_draw.c

===================================================================

diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index 0157bc567ca..46b53a369e3 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -1412,6 +1412,12 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
 		ofs = NULL;
 	}
 
+	GPUFrameBuffer *old_fb = GPU_framebuffer_active_get();
+
+	if (old_fb)  {
+		GPU_framebuffer_restore();
+	}
+
 	const bool own_ofs = (ofs == NULL);
 	DRW_opengl_context_enable();
 
@@ -1556,6 +1562,10 @@ ImBuf *ED_view3d_draw_offscreen_imbuf(
 
 	DRW_opengl_context_disable();
 
+	if (old_fb)  {
+		GPU_framebuffer_bind(old_fb);
+	}
+
 	if (ibuf->rect_float && ibuf->rect)
 		IMB_rect_from_float(ibuf);



More information about the Bf-blender-cvs mailing list