Fix T62845 VSE preview crash when setting rendered (EEVEE/Workbench)

This commit is contained in:
Clément Foucault 2019-03-23 19:09:25 +01:00
parent d057dea7ae
commit 0a89c3954f
Notes: blender-bot 2023-02-14 06:05:22 +01:00
Referenced by issue #62845, VSE preview crash when setting rendered (EEVEE/Workbench)
1 changed files with 6 additions and 0 deletions

View File

@ -952,6 +952,10 @@ ImBuf *sequencer_ibuf_get(
*/
G.is_break = false;
/* Rendering can change OGL context. Save & Restore framebuffer. */
GPUFrameBuffer *fb = GPU_framebuffer_active_get();
GPU_framebuffer_restore();
if (special_seq_update)
ibuf = BKE_sequencer_give_ibuf_direct(&context, cfra + frame_ofs, special_seq_update);
else if (!U.prefetchframes) // XXX || (G.f & G_PLAYANIM) == 0) {
@ -959,6 +963,8 @@ ImBuf *sequencer_ibuf_get(
else
ibuf = BKE_sequencer_give_ibuf_threaded(&context, cfra + frame_ofs, sseq->chanshown);
GPU_framebuffer_bind(fb);
/* restore state so real rendering would be canceled (if needed) */
G.is_break = is_break;