diff options
Diffstat (limited to 'source/blender')
3 files changed, 11 insertions, 20 deletions
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index d528160797d..c3118ca320c 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -267,12 +267,15 @@ void GPU_viewport_stereo_composite(GPUViewport *viewport, Stereo3dFormat *stereo return; } /* The composite framebuffer object needs to be created in the window context. */ - GPU_framebuffer_ensure_config(&viewport->stereo_comp_fb, - { - GPU_ATTACHMENT_NONE, - GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[0]), - GPU_ATTACHMENT_TEXTURE(viewport->color_render_tx[0]), - }); + GPU_framebuffer_ensure_config( + &viewport->stereo_comp_fb, + { + GPU_ATTACHMENT_NONE, + /* We need the sRGB attachment to be first for GL_FRAMEBUFFER_SRGB to be turned on. + * Note that this is the opposite of what the texture binding is. */ + GPU_ATTACHMENT_TEXTURE(viewport->color_overlay_tx[0]), + GPU_ATTACHMENT_TEXTURE(viewport->color_render_tx[0]), + }); GPUVertFormat *vert_format = immVertexFormat(); uint pos = GPU_vertformat_attr_add(vert_format, "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); diff --git a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl index 9b1e6fe9d23..522f6de169d 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl @@ -5,18 +5,6 @@ #define S3D_INTERLACE_COLUMN 1 #define S3D_INTERLACE_CHECKERBOARD 2 -/* Composite stereo textures */ - -#ifndef USE_GPU_SHADER_CREATE_INFO -uniform sampler2D imageTexture; -uniform sampler2D overlayTexture; - -uniform int stereoDisplaySettings; - -layout(location = 0) out vec4 imageColor; -layout(location = 1) out vec4 overlayColor; -#endif - #define stereo_display_mode (stereoDisplaySettings & ((1 << 3) - 1)) #define stereo_interlace_mode ((stereoDisplaySettings >> 3) & ((1 << 3) - 1)) #define stereo_interlace_swap bool(stereoDisplaySettings >> 6) diff --git a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh index 4b2d59cc159..3cacd0f4b8d 100644 --- a/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh +++ b/source/blender/gpu/shaders/infos/gpu_shader_2D_image_overlays_stereo_merge_info.hh @@ -9,8 +9,8 @@ GPU_SHADER_CREATE_INFO(gpu_shader_2D_image_overlays_stereo_merge) .vertex_in(0, Type::VEC2, "pos") - .fragment_out(0, Type::VEC4, "imageColor") - .fragment_out(1, Type::VEC4, "overlayColor") + .fragment_out(0, Type::VEC4, "overlayColor") + .fragment_out(1, Type::VEC4, "imageColor") .sampler(0, ImageType::FLOAT_2D, "imageTexture") .sampler(1, ImageType::FLOAT_2D, "overlayTexture") .push_constant(Type::MAT4, "ModelViewProjectionMatrix") |