diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 15:43:18 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-08-18 16:39:27 +0300 |
commit | 2e908156d0c744e526e165b386c61a0a4d0e8ed0 (patch) | |
tree | 7a1e6beb07fcbd0e1e9a15f09b470464a4876953 /source/blender/editors/space_sequencer/sequencer_draw.c | |
parent | 63998d352256f2ab747e9e072cb77ea1df39d297 (diff) |
Fix T77564: VSE (and compositor background) lost stereoscopy preview
Issue introduced on fe045b2b77dc6d7f0b552619fe824b496d34db6c.
Since the stereoscopy compositing (anaglyph, ...) is only done for
viewports the VSE preview and compositor need to use viewports.
Reviewed by: dfelinto
Differential Revision: https://developer.blender.org/D8472
Diffstat (limited to 'source/blender/editors/space_sequencer/sequencer_draw.c')
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_draw.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index 0f4690c11d5..b784104e9ce 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -56,6 +56,7 @@ #include "GPU_matrix.h" #include "GPU_state.h" #include "GPU_vertex_buffer.h" +#include "GPU_viewport.h" #include "ED_anim_api.h" #include "ED_gpencil.h" @@ -1537,7 +1538,7 @@ static void sequencer_preview_clear(void) float col[3]; UI_GetThemeColor3fv(TH_SEQ_PREVIEW, col); - GPU_clear_color(col[0], col[1], col[2], 0.0); + GPU_clear_color(col[0], col[1], col[2], 1.0f); GPU_clear(GPU_COLOR_BIT); } @@ -1780,6 +1781,12 @@ void sequencer_draw_preview(const bContext *C, return; } + /* Setup offscreen buffers. */ + GPUViewport *viewport = WM_draw_region_get_viewport(region); + + GPUFrameBuffer *framebuffer_overlay = GPU_viewport_framebuffer_overlay_get(viewport); + GPU_framebuffer_bind_no_srgb(framebuffer_overlay); + /* Setup view. */ sequencer_display_size(scene, viewrect); UI_view2d_totRect_set(v2d, viewrect[0] + 0.5f, viewrect[1] + 0.5f); @@ -1798,6 +1805,9 @@ void sequencer_draw_preview(const bContext *C, ibuf = sequencer_ibuf_get( bmain, depsgraph, scene, sseq, cfra, frame_ofs, names[sseq->multiview_eye]); + /* sequencer_ibuf_get can call GPU_framebuffer_bind. So disable srgb framebuffer again. */ + GPU_framebuffer_bind_no_srgb(framebuffer_overlay); + if (ibuf) { scope = sequencer_get_scope(scene, sseq, ibuf, draw_backdrop); |