Repository navigation
feat(shader): store D16 data to SINT storage images - #5899
Conversation
51768ef to
8c11937
Compare
jotitadev
left a comment
There was a problem hiding this comment.
Run on an Apple GPU, since the PR was tested only on an RTX 3080.
GPUs tested: Apple M2 Max, MoltenVK 1.4.2 (Vulkan 1.4.357), macOS 27.2, x86-64 under Rosetta
main does not run the GPU tests on macOS yet, so I tested on macos-port at b7eb6b6b (mugurc/AnyPS5) plus the ImportWatched change from #1, with this PR's own diff (merge-base..head 8c1193744) applied. Not main. Release build, LunarG Vulkan SDK 1.4.363.0. Suite: ctest -R "^agc" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64" -j1 --timeout 30. Without the PR, 13 tests fail on this setup (7 with the #2704 build), all known macOS failures listed in #1. One hunk in ResourceMaterializer.cpp conflicts trivially: the branch's throw has another condition. I resolved it to the PR's side, which removes the throw.
agc_driver_image_store_sintpasses. That covers the D16 stores with DMASK 0xf and 0x5 to all eight SINT formats, and the store afterimage_atomic_add.- With only the new test on the unchanged branch, it fails with
stores 16-bit data to an image of a SINT format, the refusal in the description. - Suite: the same 13 failures with and without the PR. None new, none fixed.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Thanks for the M2 Max / MoltenVK run. |
|
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.
|
|
Tested on Linux x86-64 (Release build, lavapipe / llvmpipe LLVM 20.1.2), with 8c11937 merged into main 44df216:
AI-assisted: yes (Claude Code) |
image_store with D16 data to a storage image of a SINT format threw "stores 16-bit data to an image of a SINT format", both when the descriptor is decoded and in the SPIR-V image emitter, and the runtime image modes left out the SINT conversions for such images. God of War Ragnarok (PPSA08330) stops on it in compute shader 0x1052a17900 right after its MFSR setup. Each 16-bit half is now converted like the D16 format buffer stores (EmitD16StoreComponent): sign-extended, then saturated to the component width as for 32-bit data. The buffer form was measured on RDNA2 in boykopovar#331; the image form is not measured (TechnicalDebt). agc_driver_image_store_sint now stores D16 data with DMASK 0xf and 0x5 to all eight SINT formats and after an image_atomic_add on 32_SINT, instead of expecting the refusal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Measured Added on top: the |
8c11937 to
d8c2b71
Compare
What
image_storewith D16 data into a storage image of a SINT format threwstores 16-bit data to an image of a SINT format. God of War Ragnarök (PPSA08330) hits it in compute shader0x1052a17900right after its MFSR setup (#5796).The throw was in two places:
ResourceMaterializer);StoreTexel).RuntimeImageModesalso left the SINT conversions out for images with 16-bit data.EmitD16StoreComponent, the function the D16 format buffer stores already use: sign-extend, then saturate to the component width the same way as for 32-bit data.docs/dev/debt/shader.mdnow says so.Tested
BUILD_TESTING=ON, on main 5a6ad0e.agc_driver_image_store_sint:image_atomic_addon 32_SINT. It checks every texel against the model "16-bit half → sign-extend → saturate". The input edge values include 0x7fff, 0x8000, 0xffff and 0x0000.16_SINT texel (2, 0) component 0 is 0x00007fff, expected 0x0000ffff).ctest -R "agc|shader|recompiler": 536/536 pass.tools/check_conventions.py --base origin/mainandtools/check_test_registration.pypass.0x1052a17900.compute shader 0x10527dd300: sampling, gathering or querying LOD of a converted unorm image is not implemented(the 11_11_10 UNORM sampling gap in the debt list).Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repository🤖 Generated with Claude Code