Revert "Fix T77564: VSE (and compositor background) lost stereoscopy preview"

This reverts commit d5b5b228e4.
This reverts commit 47c6f41b89.
This commit is contained in:
Clément Foucault
2020-08-24 11:11:00 +02:00
parent ebf10b72b0
commit 40edb84dcf
5 changed files with 4 additions and 42 deletions

View File

@@ -47,13 +47,11 @@
#include "BIF_glutil.h"
#include "GPU_batch_presets.h"
#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#include "GPU_matrix.h"
#include "GPU_state.h"
#include "GPU_viewport.h"
#include "WM_api.h"
#include "WM_types.h"
@@ -1773,18 +1771,10 @@ void drawnodespace(const bContext *C, ARegion *region)
SpaceNode *snode = CTX_wm_space_node(C);
View2D *v2d = &region->v2d;
UI_view2d_view_ortho(v2d);
/* 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);
GPU_batch_presets_reset();
UI_ThemeClearColor(TH_BACK);
GPU_clear(GPU_COLOR_BIT);
GPU_depth_test(false);
UI_view2d_view_ortho(v2d);
/* XXX snode->cursor set in coordspace for placing new nodes, used for drawing noodles too */
UI_view2d_region_to_view(&region->v2d,

View File

@@ -50,14 +50,12 @@
#include "IMB_colormanagement.h"
#include "IMB_imbuf.h"
#include "GPU_batch_presets.h"
#include "GPU_framebuffer.h"
#include "GPU_immediate.h"
#include "GPU_immediate_util.h"
#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"
@@ -1539,7 +1537,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], 1.0);
GPU_clear_color(col[0], col[1], col[2], 0.0);
GPU_clear(GPU_COLOR_BIT);
}
@@ -1777,14 +1775,6 @@ 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);
GPU_batch_presets_reset();
GPU_depth_test(false);
if (sseq->render_size == SEQ_PROXY_RENDER_SIZE_NONE) {
sequencer_preview_clear();
return;
@@ -1808,9 +1798,6 @@ 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);

View File

@@ -61,7 +61,6 @@ typedef struct GPUOffScreen GPUOffScreen;
GPUFrameBuffer *GPU_framebuffer_create(void);
void GPU_framebuffer_free(GPUFrameBuffer *fb);
void GPU_framebuffer_bind(GPUFrameBuffer *fb);
void GPU_framebuffer_bind_no_srgb(GPUFrameBuffer *fb);
void GPU_framebuffer_restore(void);
bool GPU_framebuffer_bound(GPUFrameBuffer *fb);

View File

@@ -544,18 +544,6 @@ void GPU_framebuffer_bind(GPUFrameBuffer *fb)
glViewport(0, 0, fb->width, fb->height);
}
/* Workaround for binding a srgb framebuffer without doing the srgb transform. */
void GPU_framebuffer_bind_no_srgb(GPUFrameBuffer *fb)
{
GPU_framebuffer_bind(fb);
glDisable(GL_FRAMEBUFFER_SRGB);
GPUTexture *first_target = fb->attachments[GPU_FB_COLOR_ATTACHMENT0].tex;
const bool is_srgb_target = (first_target && (GPU_texture_format(first_target) == GPU_SRGB8_A8));
GPU_shader_set_framebuffer_srgb_target(!is_srgb_target);
}
void GPU_framebuffer_restore(void)
{
if (GPU_framebuffer_active_get() != NULL) {

View File

@@ -308,9 +308,7 @@ static void wm_region_test_xr_do_draw(const wmWindowManager *wm,
static bool wm_region_use_viewport_by_type(short space_type, short region_type)
{
return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE, SPACE_NODE) &&
region_type == RGN_TYPE_WINDOW) ||
((space_type == SPACE_SEQ) && region_type == RGN_TYPE_PREVIEW);
return (ELEM(space_type, SPACE_VIEW3D, SPACE_IMAGE) && region_type == RGN_TYPE_WINDOW);
}
bool WM_region_use_viewport(ScrArea *area, ARegion *region)