diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2022-11-03 16:17:50 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2022-11-07 11:54:15 +0200 |
commit | 75b6758fd24221e3def47c2f9c0ccca17e6f5e28 (patch) | |
tree | 1a59e1c355d5fa54684b85a687c1cc23fa3fed9b /clients | |
parent | 9b455e24a2fb3fc77dc010954f0c2aa34e11afc2 (diff) | |
download | weston-75b6758fd24221e3def47c2f9c0ccca17e6f5e28.tar.gz |
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 <marius.vlad@collabora.com>
Diffstat (limited to 'clients')
-rw-r--r-- | clients/simple-dmabuf-feedback.c | 5 |
1 files changed, 4 insertions, 1 deletions
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"; |