fix(client/gl): don't toggle flip_y on window-space layers (#429)#430
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_spaceblanket-toggledflip_ylike 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_SPACEUV flip + NDC geometry flip) and ignoresflip_yentirely. The D3D11 service honorsflip_yas a V-range flip (comp_d3d11_service.cppHUD compose), so the bogusflip_y=trueflipped 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_winstandalone (in-process GL native compositor): HUD upright ✅ (unchanged —flip_yis ignored there)cube_handle_gl_winunder the shell (IPC → D3D11 service): HUD upright ✅ (was flipped before)flip_ytoggle is untouched)🤖 Generated with Claude Code