Repository navigation
fix(agc): read a 32-bit depth-bits T# over guest memory through a float view - #7346
Conversation
…at view A sampled 32_UINT or 32_SINT T# with a depth swizzle that no live depth surface matches threw, while the 16-bit case already falls back to guest memory through an R16_UNORM view. The 32-bit case now reads the guest bytes through an R32_SFLOAT view, which the shader casts back to the stored dword. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
One convention issue: the new two-line source comment immediately above |
|
The new diagnostic on #5398 confirms this is the guest-memory case your patch targets: the exact descriptor is |
|
@thuanquang, thanks for this. We had the same change on a fork branch this evening, not opened, so it's all yours. Its test covers a few of the cases your Tested section lists as not tested, and you're welcome to take it as is: branch
|
|
Ran it on the title and on NVIDIA. RTX 4090 (NVIDIA 616.92), Windows 11 26200, Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7, Release; tree
NHL 26: the depth-layout stop is gone. On
So on NVIDIA Ada the PR does what it says for the title: the depth-layout refusal is gone in all three runs, and the next stops are #7048's storage-image refusal and a libSceJson2 null-text throw. Full stderr of runs 2 and 3 below. AI-assisted: yes (Claude Code). |
run 2, warm cache, ends on the #7048 refusal, stderr (32 of 173 lines; per-shader registration notes and the 10 s counters trimmed) |
run 3, warm cache, ends on the libSceJson2 throw: stderr, 853 of 9866 lines (kept: the first 40, the last 60, and every driver/exception line with one line of context) |
|
Agreed with @MarcZX10: please remove the two-line comment above |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Removed in 4aaa125; that commit only deletes the two lines. @frankea, thanks for the RTX 4090 and NHL 26 runs. I added them to the Tested section. @EagleBearerYS, thanks for the extra test. I'd rather keep this PR as it was reviewed so it can go in. |
What
NHL 26 (PPSA26785) aborts before its first frame on plain
main, in all of @frankea's three runs on an RTX 4090, with this message (#5398, discussion #7304):@milchgeldkassierer posted its T# words (
0x11c10f00 0xc1400000 0x010dc1df 0x91800fac 0 0x00700000 0 0): 32_UINT, swizzle 24 (SW_64KB_Z_X), 1920x1080, no metadata. A second one at0x11c0000000is 1176x664. A local switch that read them from guest memory like any other texture got the title past the stop.The recompiler treats a sampled 32_UINT or 32_SINT T# with a depth swizzle as a depth-bits read. It declares a float image and casts the fetched value back to the dword. When no live depth surface matches,
cachedTexturethrew. The 16-bit case already falls back to guest memory through an R16_UNORM view (#188). The 32-bit case now does the same through an R32_SFLOAT view: it detiles the guest bytes as any 32-bit texture, and the shader casts them back unchanged.That only works if the host returns the stored bits of an R32_SFLOAT texel unchanged. On the RX 6700 XT it does, for float denormals, the sign bit alone and quiet and signaling NaN payloads (the test below). A debt entry records that other drivers are not measured.
The same goes for a live depth surface whose extent or base level differs from the T#: the read takes the guest bytes, as the 32-bit float and 16-bit views already do on
main. Whether NHL's0x11c10f0000was ever drawn as depth is the open question @MarcZX100 asked on #5398. If it was, the GTAO input could be stale rather than missing.Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,ANYPS5_REQUIRE_VULKAN=1:agc_driver_depth_plane_samplinghas a new case.SW_64KB_Z_XT#s over guest memory that no depth surface was drawn into. Each slice is filled with one dword:0x00000001,0x007fffff,0x80000000,0x80000001,0x7f800001,0x7fc00001,0xffffffff,0x3e800000and0x12345678.image_loadof a row must return each dword bit for bit.main5229b5b82it fails with the title's message:32-bit integer read of the depth-layout texture 0x200480000, which is no depth surface drawn with, is not implemented.ctest --parallel 4 --timeout 120onmain5229b5b82with this change: 1441 tests. The failures are the onesmainhas here without it:agc_driver_lds_mixed_width_atomics(agc_* tests: 3 of 483 fail on AMD Radeon RX 6400, pass on NVIDIA RTX 4080 SUPER #5271, fix(shader): release the LDS lock with an exchange and drop fences inside it #6976),agc_driver_registration_trace(fixed by fix(agc): keep one trace thread pointer and recording flag across modules #7336, merged since), andagc_driver_layered_volume_draw,agc_driver_layered_volume_vertex,agc_driver_subvector_loopandagc_driver_lds_lock_budget. I checked the last four onmain5229b5b82without this change, and they fail there too.agc_driver_depth_plane_samplingpasses 3 of 3, and NHL 26 no longer stops here. A warm-cache run went on to the next stop at frame 423, the pending storage image refusal of fix(agc): save the guest bytes of results that become pending over a surface that is no longer fully write-watched #7048.python tools/check_conventions.py --base origin/mainwith this title and body passes.image_sample(the test usesimage_load; both go throughcachedTexture);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)v_readlane_b32) on a 32-lane host, NHL 26 (PPSA26785) stops at start-up #5398 (its first stop onmain)🤖 Generated with Claude Code