Skip to content

fix(client/gl): don't toggle flip_y on window-space layers (#429)#430

Merged
dfattal merged 1 commit into
mainfrom
fix-429-gl-windowspace-flip-ipc
Jun 5, 2026
Merged

fix(client/gl): don't toggle flip_y on window-space layers (#429)#430
dfattal merged 1 commit into
mainfrom
fix-429-gl-windowspace-flip-ipc

Conversation

@dfattal
Copy link
Copy Markdown
Collaborator

@dfattal dfattal commented Jun 5, 2026

Summary

Fixes #429 — an OpenGL client's window-space (HUD) layer rendered Y-flipped under the workspace/shell (IPC → D3D11 service) while standalone (in-process GL) was upright.

Root cause

client_gl_compositor_layer_window_space blanket-toggled flip_y like every other layer type. That toggle is correct for GL-rendered content (bottom-up framebuffer rows, e.g. the projection layer — which is why projection is upright on both paths), but window-space HUD pixels are CPU-uploaded top-down (D2D/CG row order), so the shared texture already matches the D3D11 convention and needs no flip.

The mismatch was invisible in-process because the GL native compositor bakes the top-down contract into its window-space shader (VS_WINDOW_SPACE UV flip + NDC geometry flip) and ignores flip_y entirely. The D3D11 service honors flip_y as a V-range flip (comp_d3d11_service.cpp HUD compose), so the bogus flip_y=true flipped an already-top-down HUD.

Fix

Pass window-space layer data through unchanged in the GL client (one site), with a comment documenting the orientation contract.

Testing

  • cube_handle_gl_win standalone (in-process GL native compositor): HUD upright ✅ (unchanged — flip_y is ignored there)
  • cube_handle_gl_win under the shell (IPC → D3D11 service): HUD upright ✅ (was flipped before)
  • Projection layer upright on both paths (its flip_y toggle is untouched)

🤖 Generated with Claude Code

The GL client compositor blanket-toggled flip_y on every layer type,
including window-space (HUD) layers. That toggle is correct for
GL-rendered content (bottom-up framebuffer rows), but window-space HUD
pixels are CPU-uploaded top-down (D2D/CG row order), so the shared
texture already matches the D3D11 convention.

In-process this went unnoticed: the GL native compositor bakes the
top-down contract into its window-space shader and ignores flip_y. On
the IPC/workspace path the D3D11 service honors flip_y as a V-flip, so
GL clients' HUDs rendered upside down while projection stayed correct.

Pass window-space layer data through unchanged. Verified upright both
standalone (in-process GL) and under the shell (IPC -> D3D11 service)
with cube_handle_gl_win.

Fixes #429

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dfattal dfattal enabled auto-merge (rebase) June 5, 2026 06:50
@dfattal dfattal merged commit 9a1ef7c into main Jun 5, 2026
9 checks passed
@dfattal dfattal deleted the fix-429-gl-windowspace-flip-ipc branch June 5, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

OpenGL clients: window-space layers (HUD) are Y-flipped under workspace/shell (IPC -> D3D11 service)

1 participant