feat(agc): implement sint storage images through uint views #944
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/944"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-06T19:23:46Z.
What
SINT storage images throw
storage image descriptor uses an unsupported format, except write-only 32_SINT.EmitFormatStoreComponent); 32-bit SINT formats store raw dwords, also withimage_store_pck.StoreTexeltakes Y, as it does for UINT onmain(TechnicalDebt).StorageTexture::StorageViewbinds a cached same-size UINT view; loads keep the sign-extending SINT view.main),image_store_pckof 8- and 16-bit components, and atomics other than 32-bit ones on 32_SINT and 64-bit ones on 32_32_SINT.StoreTexeland the storage descriptor write; whichever lands second keeps the SINT saturation andStorageView. #757-#759, #920, #866, #1058 and #290 edit the same functions and merge cleanly with this.Tested
main878e6a6b: configure-DBUILD_TESTING=ON, full build,--target libs,ctest:ctest --output-on-failure)VK_DRIVER_FILES): 387/387 pass;agc_driver_flat_storeis left out there because it takes several minutes on Windows llvmpipeagc_driver_image_store_sint: eight formats, dmask 0xf and 0x5, 24 edge values and X,Y,0,1 on two-channel formats, animage_loadread-back,image_store_pckon the 32-bit formats, the title's store (dmask 0x1 glc, DST_SEL X,1,1,1) and six throws; fails onmainwith the message above.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T09:37:42Z.
Review: CHANGES_REQUESTED
Measured on the HW oracle (gfx1035, raw
image_store+ read-back): 8 formats × dmask 0xf/0x5 × 24 edge values. With X,Y,0,1 selectors on the two-channel formats all 448 rows match this PR (per-component saturation, zero for components outside dmask, raw 32-bit). Build + ctest green, and the new test fails without the change. Three things before merging:ImageStoreSint.cpp:34/:289: the test stores to 8_8, 16_16 and 32_32 SINT with DST_SEL X,Y,Z,W (0xfac). With that T#, the hardware writes channel 1 of a two-channel format from the W data slot, not from Y. dmask 0xf of (0x11, 0x22, 0x33, 0x44) stores (0x11, 0x44), and dmask 0x3 stores (0x11, 0). So the dmask 0xf rows pin values the console doesn't produce (86 rows differ on 8_8/16_16/32_32).StoreTexelbehaves the same for UINT onmain, so it predates this PR. Please use X,Y,0,1 (0x22c) for the two-channel formats so the test only pins what the hardware does. The W-slot aliasing can go to TechnicalDebt or a separate PR.TechnicalDebt.md:146: image stores are measured now. Either drop the line or say that they were measured on RDNA2 (gfx1035).ShaderResources.cpp:1060conflicts withmainafter #896 (Atomic64View). Please rebase and keep both branches, as you noted in the description.Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-07T10:16:59Z.
Thanks for measuring the stores on gfx1035. The 448 matching rows are exactly what the PR was missing, and I hadn't noticed that with X,Y,Z,W the hardware writes channel 1 from the W slot.
I've force-pushed
6e34e8614with all three points:0x22c) in the store loop, theimage_loadread-back and the 32_32image_store_pckrow, so the test only pins what the hardware does. The expected values didn't need to change.StoreTexeldoes the same for UINT. The image-store line now says the saturation was measured on RDNA2 (gfx1035) and that the PS5's gfx1013 isn't measured.buildComplete: the storage descriptor write picksAtomic64View, thenAtomicView, thenStorageView.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-07T11:46:31Z.
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.
main)docs/dev/TechnicalDebt.mdL204Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-07T11:56:14Z.
Review: APPROVED
Thanks for the quick turnaround. Checked
6e34e8614on RADV (gfx1035 oracle for the hardware side):image_storerows (8 formats × dmask 0xf/0x5 × 24 edge values, X,Y,0,1 on two-channel formats) and the test's other forms (dmask 0x1 glc with X,1,1,1 on 16_SINT,image_store_pckdmask 0x3 on 32/32_32/32_32_32_32_SINT, 128 rows) all match.agc_driver_image_store_sintfails without the change.Merging.