Files
looking-glass-2/client/renderers/EGL/shader/compose.vert
T
donny e35d51ea39
build / client (Debug, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Debug, map[cc:gcc cxx:g++], libdecor) (push) Failing after 34s
build / client (Debug, map[cc:clang cxx:clang++], libdecor) (push) Failing after 44s
build / client (Debug, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 27s
build / client (Release, map[cc:clang cxx:clang++], libdecor) (push) Failing after 20s
build / client (Release, map[cc:clang cxx:clang++], xdg-shell) (push) Failing after 20s
build / client (Release, map[cc:gcc cxx:g++], libdecor) (push) Failing after 22s
build / client (Release, map[cc:gcc cxx:g++], xdg-shell) (push) Failing after 20s
build / module (push) Failing after 19s
build / host-linux (push) Failing after 21s
build / host-windows-cross (push) Failing after 21s
build / obs (clang) (push) Failing after 21s
build / docs (push) Failing after 13s
build / obs (gcc) (push) Failing after 20s
build / host-windows-native (push) Canceled after 0s
build / idd (push) Canceled after 0s
client: fix the composed desktop being rendered upside down
The composition pass flipped Y when writing into its framebuffer, but the
desktop shader that samples it treats row 0 as the top, so the composed
desktop reached the screen inverted. The layout metadata was correct
throughout, which is why the geometry checks never caught it.

Adds a rendering test that catches this class of bug: a synthetic host
publishes three displays stacked vertically in the atlas but laid out in a
row on the desktop, and the client is rendered into a virtual X server and
sampled. Each display carries a marker in its top left corner, so an
inverted or transposed composition fails even though the colours would
otherwise land in the right places.
2026-07-28 08:00:37 +00:00

32 lines
1.1 KiB
GLSL

#version 300 es
precision highp float;
/* Composes a packed multi-display atlas into the guest's virtual desktop.
*
* Unlike the desktop shader, the texture coordinate is supplied per vertex
* rather than derived from the position: a display's place in the atlas has
* nothing to do with its place on the desktop, so the two cannot be tied
* together. */
layout(location = 0) in vec2 vertex; // position in view pixels
layout(location = 1) in vec2 texture; // source position in atlas pixels
out vec2 uv;
uniform vec2 viewSize;
uniform vec2 atlasSize;
void main()
{
/* View pixels to clip space.
*
* Y is deliberately not flipped. This shader renders into a framebuffer
* whose texture is then sampled by the desktop shader, which treats row 0
* of the image as the top, matching the order rows arrive in the frame.
* Writing clip Y directly keeps the composed texture in that same order;
* flipping here would hand the next stage an upside down desktop. */
gl_Position = vec4(vertex / viewSize * 2.0 - 1.0, 0.0, 1.0);
uv = texture / atlasSize;
}