diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-07-31 19:20:57 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-07-31 19:21:23 +0300 |
commit | 6ba70d5996a4fdb82516d199dacfee066f2b3bfc (patch) | |
tree | a0abd26bb8bf2a188175f809898a1a3f7bb0d3c6 | |
parent | 7e0eb0d071776ea938a70737fb3a0a9592264e94 (diff) |
Fix crash when rendering viewport within another area
This also Fix T55574 Crash on sequencer preview
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 10 |
1 files changed, 10 insertions, 0 deletions
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); |