Fix crash when rendering viewport within another area

This also Fix T55574 Crash on sequencer preview
This commit is contained in:
Clément Foucault
2018-07-31 18:20:57 +02:00
parent 7e0eb0d071
commit 6ba70d5996

View File

@@ -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);