Repository navigation
fix(agc): start the color masks and viewport control at their reset values - #16053
Conversation
e2e6599 to
0f6ecb3
Compare
|
Hi @stuart-russell, thanks for this. I checked the new reset values against the amdgpu clear-state tables, and they match: One problem with how a draw decodes
Could you either add the position pre-transform (and the 1/W handling) for this value, or keep the reset value at 0 but leave a draw with |
|
Windows check of head Setup: Windows 11 Enterprise 22621, WinLibs GCC 15.2 UCRT, Release, with
AI-assisted: yes. |
0f6ecb3 to
e5e7eac
Compare
|
The
Cause: this branch made Fix in Reproduced locally: |
❌ NVIDIA GPU test: failedPR head
Failing testsThis PR changes test files, so each failing test was also built and run on main with only the PR's test changes applied. ✅ there means the failure comes from the PR's other changes; ❌ means the test fails on main too, so this run does not show the PR caused it.
agc_driver_submit_progress: Failed (also failed when re-run alone), assertion and diagnosticsUnstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validation IDs already present on main (9 IDs in 593 tests)Skipped (52)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
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.
|
gabichuuuuu
left a comment
There was a problem hiding this comment.
Ran e5e7eace2a merged on main 302864d on Windows 11 x64 (WinLibs GCC 15.2), ctest -R '^agc_driver_graphics$' -V, with ANYPS5_REQUIRE_VULKAN=1 and ANYPS5_NO_SHADER_CACHE=1, on both an NVIDIA laptop GPU (Turing, driver 621) and an Intel iGPU (driver 101.70xx) selected:
main |
main + only this PR's Graphics.cpp diff |
change, 2 runs each | |
|---|---|---|---|
| NVIDIA | passed | failed | passed |
| Intel | passed | failed | passed |
- Without the
QueueState.hpp/State.cppchanges, the updated test stops at "the initial viewport control is not its reset value". With them, it passes every time. agc_driver_graphicsruns againstMockVulkan, so this covers the decode path (as on the description's machine) on two more hosts, not a draw on a real device. I didn't runagc_driver_pm4.
From reading:
- The
PA_CL_VTE_CNTL0 branch skips the scale/offset registers entirely, so a title that leaves them unwritten no longer reaches the "unsupported viewport transform" refusal. depthScale,depthOffsetand the depth clamp bounds aren't set in that branch, so they keepState's defaults (scale 1, offset 0, clamp 0 to 1).drawCoversandDrawRejectionaccept the same two values asDecodeState, so the three can't disagree.
AI-assisted: yes.
|
Test runs for head Linux: Ubuntu 26.04.1, RTX 4070 Ti, NVIDIA 615.71.09, GCC 15.2, Release.
Windows: Windows 11 VM, GeForce GT 1030 (Pascal), NVIDIA 582.78, WinLibs GCC 15.2 UCRT, Release.
Every test I ran passes on this head, apart from any skips listed. AI-assisted: yes (Claude Code) |
|
A GFX8 data point: AMD Radeon RX 570 (RADV POLARIS10), Mesa 26.2.5, SteamOS 3.8.28 (Arch distrobox), GCC 16.2.1, Release. Head
The 1,499 AGC, shader, VideoOut and Vulkan tests, this PR on
AI-assisted: yes (Claude Code) |
|
Thanks — all three readings are right, and the two "from reading" points are intended rather than incidental.
With your Turing laptop and Intel iGPU, @milescoviello's RTX 4070 Ti and @ryanc2112's RX 570 (RADV GFX8), the decode path now has coverage on five GPU families across three vendors, plus the Windows and MinGW runs already on the thread — and the control case (this PR's decode without the reset values) fails on each of them, which is the useful half. |
|
This PR on an AMD GPU under Windows, with AMD's own driver: the 27 focused tests pass 3 of 3, and the full AGC suite matches Setup: Windows 10 Home 22H2 (10.0.19045), AMD Radeon RX 6750 XT, AMD Software Adrenalin 26.10.1 (driver 32.0.21045.16010), WinLibs GCC 15.2.0 r7 UCRT, Release, Focused tests: Full suite:
AI-assisted: yes. |
Validation run — queue item 24 (PR #16053)Environment
SHAs
Build
Focused tests (identical matched set in both trees, 22 tests)Pattern (saved in Command run in each tree (timeout 3600 each): Results
Per-test outcomes identical between trees (all 22 Layer checks (per AGENTS.md)
VUID / validation-ID diff
Push
VerdictPASS — PR builds clean and the focused AGC color-mask/viewport/reset-state test set is 22/22 on both base and PR on Linux/AMD RX 9070 XT (RADV) with the Khronos validation layer active and no new validation IDs. Limitations
|
…alues CB_TARGET_MASK and CB_SHADER_MASK resets to all channels on every target, and PA_CL_VTE_CNTL resets to 0, where no viewport transform is enabled. A draw that never programs either therefore wrote no color and decoded a (-1,-1) 2x2 viewport from registers it never set, and every draw was discarded. Give such a draw a viewport covering its render target, accept 0 in the draw rejection and the coverage check, and keep 0x43f on the register-derived path.
e5e7eac to
bade673
Compare
|
Rebased onto current Re-verified on the rebased head: Thanks for the validation run — the zero-validation-ID result and the matched 22/22 across base and PR on RADV are exactly the evidence this needed, on top of the NVIDIA/Intel/RDNA2/GFX8 reports already on the thread. |
|
Matched regression evidence for Kao the Kangaroo (PPSA05595) on Linux RX6650XT:
Raw-orientation menu comparison · matched source/cache pins and diagnostic patch. The existing AGC public default table contains For the separate sampler blocker I measured local gfx1032 hardware: RGBA8 sRGB format130 with sampler word0 bit31 set equals UNORM format56 sampling bit-for-bit in 64/64 lanes, for both point and bilinear filtering; two fixed repeats of all eight modes agree. Plain sRGB differs from UNORM in all64 lanes; the UNORM numeric control has maximum absolute error below3e-8. Hardware inputs, results and replay script. This is local RDNA2 evidence, not a PS5 hardware-equivalence claim. No sampler refusal has been removed. Follow-up: #20728 implements direct sampled-image SKIP_DEGAMMA through compatible UNORM views. Expanded native gfx1032 measurements cover all seven sRGB families, point/bilinear and FORCE precedence (70 modes, two stable repeats each). Matched Linux qualification gives main five passing gates/two expected SKIP failures and change seven passes, with six realGPU cases per arm and zero skips/VUIDs. This addresses the sampler behavior exposed by the private viewport diagnostic; the viewport-default regression remains separate and no title unblock is claimed. Additional integration check: current main This is an integration-only observation, not separate causal attribution to either PR or a title-unblock claim. The combination has not resolved the rendering regression. Source pins, logs and reduced raw-orientation native capture. |
|
A second title with the same regression: GTA V (PPSA04264 01.005.000) on Windows. Host: Windows 11 Pro 26300, Ryzen 7 5800X3D, RTX 5070 Ti (NVIDIA 621.01), WinLibs GCC 15.2.0 r7 Release, relinked with
So the title draws with the initial AI-assisted: yes |
Since the reset values change (boykopovar#16053) the queue start and CLEAR_STATE set PA_CL_VTE_CNTL to 0, which the decoder reads as positions without a viewport transform: the draw gets a viewport over its whole render target and a depth range of 0..1, ignoring the title's z scale and offset. Red Dead Redemption (PPSA30528) never programs the register after CLEAR_STATE, so its reversed-depth viewport lost its z mapping and far surfaces drew over near ones (faces through hats, walls see-through). With 0x43f restored on the same build its frame matches the earlier builds again; restoring the color masks alone did not change it. A title that writes 0 itself still gets the covering viewport, and the color masks keep their all-channel reset value. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rol was never written (#23165) Since #16053 a draw whose PA_CL_VTE_CNTL is still 0 gets a viewport covering its render target. A title that programs the viewport scale and offset registers but never writes the control lost its transform that way, and with a negative Y scale its whole image was drawn upside down (PPSA04263). Take the covering viewport only while the first viewport's six transform words are still at their initial values, and use the programmed transform otherwise, in the state decode and in the coverage check.
What
CB_TARGET_MASK(0x8e) andCB_SHADER_MASK(0x8f) reset to0xffffffff, andPA_CL_VTE_CNTL(0x206) resets to 0. A title that never programs them got the driver's former zeros instead: the masks meant nothing was written, andPA_CL_VTE_CNTL0 threw, or, once accepted, decoded a viewport of (-1,-1) 2x2 from registers the title never wrote, so every draw was discarded.0xffffffff.CLEAR_STATErestores the same values throughInitialContextRegisters.PA_CL_VTE_CNTLat 0 and give a draw with that value a viewport covering its render target.0x43fkeeps the register-derived viewport, and any other value still throws.drawCoversand in the draw rejection.Follow-up to #10779, which is merged.
References
cb_target_maskandcb_shader_masktracking to0xFFFFFFFF(drivers/gpu/drm/radeon/r600_cs.c,r600_cs_track_init), the hardware reset value for both masks.PA_CL_VTE_CNTLenables the per-axis viewport scale and offset; decaf-emu models the disabled case as the unscaled NDC path (src/libgpu/src/vulkan/vulkan_viewscissor.cpp) and xenia reads the same enables to derive its draw extent (src/xenia/gpu/draw_extent_estimator.cc).Tested
agc_driver_pm4(18 tests) andagc_driver_graphicspass, andtools/check_conventions.py --base origin/mainpasses, ond23df92b38.ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R 'agc_driver_(pm4|graphics)' -Vpasses with noVUID-lines and without the "was not found but was requested by env var VK_INSTANCE_LAYERS" message. This machine has no Vulkan device, so that run covers the decode path only.A Windows build of the same values (MinGW cross-build, NVIDIA RTX 3070, driver 32.0.15.9186, Windows 11) ran PPSA30528 to its loading screen with audio; the run without them produced a black window. That run predates this rebase.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)