feat(agc): sample and store unsigned 10_11_11 and 2_10_10_10 images #15450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15450"
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 AlexWhitehouse on 2026-11-03T11:09:30Z.
What
Supports guest image format codes 37 and 41 (unsigned 10_11_11, UNorm and UInt) and 44 and 48 (unsigned 2_10_10_10, UNorm and UInt) for sampling, loads and stores. Before this PR they were unsupported image formats.
Layout. Codes 37 and 41 have X, Y and Z fields 10, 11 and 11 bits wide at bits 0, 10 and 21. Codes 44 and 48 have X, Y, Z and W fields 2, 10, 10 and 10 bits wide at bits 0, 2, 12 and 22.
src/amd/registers/gfx10-rsrc.json), whose namessrc/amd/common/gfx10_format_table.pyreverses into little-endian component order.Mapping.
R32_UINT, the same host format codes 30, 34, 36 and 43 already use. The shader unpacks the bitfields with the existing typed-buffer bitfield conversion.Debt. The
docs/dev/debt/libSceAgcDriver.mdandshader.mdentries say that none of the four codes, nor their store rounding, is measured on AMD or PS5 hardware.The progress scan's format coverage moves from sampled 81 to 85 and host 68 to 72, with typed buffer unchanged at 80.
Tested
agc_driver_image_unsigned_packed32_{37,41,44,48}(tests/execution/ImageConvertedUnorm.cpp). For each code, the test:XYZW, a reversed swizzle andX011;maindoes for 10_11_11. Followingfedf3e91a7, it doesn't pin gathers, border sampling or D16 as refused;Integers and UNorm endpoints must be exact. UNorm fractions allow 3 ULP, and bilinear samples use the existing 1e-5 tolerance.
agc_driver_graphics(tests/TextureFormat.cpp): the converted DCC clear checks now include 37, 41, 44 and 48. This test runs against a mock Vulkan device, so it loads no validation layer.Mutation checks: shifting the field offsets of 37 and of 44 each fails its test at the first affected bit. This was run on the first version; the conversion code is unchanged.
Required focused comparison:
ctest -R "agc_driver_image_unsigned_packed32|agc_driver_image_converted_unorm|^agc_driver_graphics$" -V, onmain(3c2af82080) and this PR (c652dd8e89). Themainruns overlay main's six non-test source files onto this PR. Both runs used the same test sources andANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.NVIDIA RTX 3060, Windows 11 (driver 610.88): main passes 1/6.
agc_driver_graphicsfails onunsupported guest texture format 37.unsigned_packed32tests fail onsampled image descriptor uses an unsupported format.This PR passes 6/6. The validation layer is confirmed loaded, and neither log has a missing-layer warning or a
VUID-error. Before the rebase, on4f41f4c375, a wider image and graphics run (74 tests) failed only those same five on main and passed all on this PR.lavapipe, Ubuntu 26.04: main passes 1/6.
agc_driver_graphicsfails onunsupported guest texture format 37.unsigned_packed32tests fail onsampled image descriptor uses an unsupported format.This PR passes 6/6. The validation layer is confirmed loaded, and neither log has a missing-layer warning or a
VUID-error.Same executable, other tests, with the same variables at
c652dd8e89and with main's six source files:agc_driver_image_packed16_storage_{133,134,136}andagc_driver_image_depth24_floatpass on both GPUs.agc_driver_image_depth24(added by #16294) passes on the RTX 3060, and on lavapipe it fails the same way with and without this PR (0x3effe004for texel0x007ff001).Wider run on lavapipe at 596a855973 (on
main7960a0bcb2), with the same variables: everyagc_driver_image_*test plusagc_driver_graphics(75 tests). 74 pass andagc_driver_image_sample_lod_clampskips, because lavapipe has noVK_EXT_image_view_min_lod. The onlyVUID-errors are fourVkSamplerCreateInfoaddress-mode IDs inagc_driver_image_gather_volume, which logs the same IDs with main's six source files.History: first written on an older
main(348d7f0d71). On the RTX 3060 then, main passed 1/6 and this change 6/6. When rebased, the 11_11_10 runtime-mode conditions follow currentmain, and the test drops the refusal checksfedf3e91a7removed upstream. Rebased again onto7960a0bcb2:DescriptorBindingBuilder.cppkeeps main's new 3D gather block, which refuses converted images, so a 3D gather of UNorm 37 or 44 throws. Rebased onto3c2af82080:kFormatInfoTablegrows from 83 entries (after #16294) to 87.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py:Depends on: #14628.kFormatInfoTablearray size inRdnaDescriptorFormat.cpp; whichever merges second rebases that line.main. None of their diffs touches the new formats orIsConvertedUnormTextureFormat.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)🤖 Generated with Claude Code