Repository navigation
fix(agc): normalize unused viewport depth ranges - #6535
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
A Linux data point from a device without
I didn't check why the last 12 still stop. I'd expect their draws to have a depth target or read PositionZ, which this PR leaves alone. One run per app and build. AI-assisted: yes |
|
A second title this clears on macOS: ProsperoLichess (PPSA99009, homebrew catalog), on Apple M2. macOS 26.7.1, Apple M2, x86-64 under Rosetta, MoltenVK from the LunarG Vulkan SDK 1.4.363, Release. A local tree of
I didn't test #4650. AI-assisted: yes |
|
A check on a device without
So ProsperoEden's out-of-range viewports are all the unused kind this PR normalizes. Signal Companion gets 8 s further and then reaches a draw whose depth range is in use, which this PR leaves alone (that one needs #4650). On NVIDIA, which has the extension, neither stops on the depth range. AI-assisted: yes (Claude Code) |
|
Rebase handoff — rebased onto current Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
To pick it up: Head is |
3782121 to
4af72dc
Compare
Use representable viewport endpoints only when the draw has no depth attachment and its pixel shader does not read PositionZ. Preserve XY coverage, clip-space mode, depth clamping, and validation of non-finite inputs. Balatro (PPSA21402) reaches rendering on Apple M1 with MoltenVK after this change instead of stopping at VK_EXT_depth_range_unrestricted. Depth-dependent draws retain their original behavior.
4af72dc to
e1e6ae0
Compare
|
Thanks.
Merging once the full Build is green. |
What
Balatro (PPSA21402) uses a viewport depth range of [-1, 1] for color-only draws. On Apple M1 with MoltenVK these stop at
viewport depth outside [0, 1] requires VK_EXT_depth_range_unrestricted, even when there is no depth attachment and the pixel shader does not read PositionZ.Normalize the viewport endpoints only for those draws. Preserve XY coordinates, clip-space mode and depth clamping. Depth attachments, PositionZ inputs and non-finite ranges keep their existing behavior and validation. The adjustment is part of the decoded draw state, so cached draws receive the same state.
This is independent of #4650, which emulates observable depth transforms, and does not include the broader Mac changes in #6222.
Tested
agc_driver_unused_viewport_depthpasses. It also runs the existing depth-clip checks and covers PositionZ reads, attached depth, reversed ranges, in-range values, non-finite rejection and preserved XY/clipping state.git diff --checkandpython3 tools/check_conventions.py --base origin/main --head fix/agc-unused-viewport-depthpass.The reasoning follows Vulkan's viewport transform and fragment operations: the changed depth value has no consumer when neither the fragment shader nor a depth attachment observes it.
Checklist
main; no other open PR implements the same function (related feat(agc): remap a viewport depth range the device cannot express into the vertex shader #4650 and Macos m4 #6222 reviewed)