Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-05-10 13:33:08 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-05-10 13:33:18 +0300
commit061995775f87a455e685c706b40fe07765fa1b3b (patch)
treeaf2b8b985e98c69c29046fcf683555a42f9c9db3 /source/blender/gpu/intern/gpu_viewport.c
parent439f86ac89bdd649aa9ccfe258c5f80474788449 (diff)
Fix T95298 ImageEditor: Multi-view images fail to display properly
This was because the shader had wrong output slot order. This also add a note about why the order is reversed compared to the texture binding.
Diffstat (limited to 'source/blender/gpu/intern/gpu_viewport.c')
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c15
1 files changed, 9 insertions, 6 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);