From 75b6758fd24221e3def47c2f9c0ccca17e6f5e28 Mon Sep 17 00:00:00 2001 From: Marius Vlad Date: Thu, 3 Nov 2022 16:17:50 +0200 Subject: [PATCH] simple-dmabuf-feedback: Correct the rectangle orientation Similar to changes in simple-dmabuf-egl, this perform a x-axis reflection as it has the same NDC values as simple-dmabuf-egl and we get an inverted image. We do it straight in the shader this time. Signed-off-by: Marius Vlad --- clients/simple-dmabuf-feedback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clients/simple-dmabuf-feedback.c b/clients/simple-dmabuf-feedback.c index f0d6febf..bc777842 100644 --- a/clients/simple-dmabuf-feedback.c +++ b/clients/simple-dmabuf-feedback.c @@ -68,7 +68,10 @@ static const char *vert_shader_text = "attribute vec4 color;\n" "varying vec4 v_color;\n" "void main() {\n" - " gl_Position = pos;\n" + " // We need to render upside-down, because rendering through an\n" + " // FBO causes the bottom of the image to be written to the top\n" + " // pixel row of the buffer, y-flipping the image.\n" + " gl_Position = vec4(1.0, -1.0f, 1.0f, 1.0f) * pos;\n" " v_color = color;\n" "}\n";