feat(agc): sample and store 1_5_5_5 UNorm images #14628
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14628"
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-01T16:36:15Z.
What
Supports guest image format code 135 (
IrBufferFormat::Format1_5_5_5UNorm) for sampling and for image loads and stores. Before this PR the descriptor table marked it unsupported and it had no Vulkan mapping.Layout. X is one bit at bit 0, and Y, Z and W are five bits each at bits 1, 6 and 11, all UNORM.
src/amd/registers/gfx10-rsrc.json) name code 135GFX10_FORMAT_5_5_5_1_UNORM, andsrc/amd/common/gfx10_format_table.pyreverses that name into little-endian component order.1_5_5_5, and the debt entry spells that out.Mapping.
VK_FORMAT_R5G5B5A1_UNORM_PACK16, with guest X, Y, Z and W read from host A, B, G and R.R16_UINTwith the existing packed-16 bitfield conversion that 133, 134 and 136 already use.GetImageFormatInfosupplies 135's layout, so typed buffers still reject it, as Table 47 requires.Debt. The
docs/dev/debt/libSceAgcDriver.mdandshader.mdentries state what is unverified on the PS5: normalization, store rounding ties and NaN handling. They also note that loads and filtering follow the host's UNORM precision: lavapipe point samples and NVIDIA loads quantize 5-bit channels to 8 bits.The progress scan's format coverage moves from sampled 81 to 82 and host 68 to 69, with typed buffer unchanged at 80.
Tested
agc_driver_image_packed16_load(tests/execution/ImagePacked16Load.cpp) now also walks every bit of the 16-bit word through 133, 134, 135 and 136. It checks endpoints,XYZW,ZYXWand another swizzle, point and bilinear samples, and that 135 is rejected as a buffer format.agc_driver_image_packed16_storage_135(tests/execution/ImageConvertedUnorm.cpp) stores through the packed-16 path and compares the guest bytes, with guard bytes around the target.storage_135atImageConvertedUnorm.cpp:512;agc_driver_image_packed16_load.ctest -R "^agc_driver_image_packed16_(load|storage_13[3-6])$" -Vonmain(f2d874c1fd) and this PR (61fb2c4955), with the same test sources andANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:sampled image descriptor uses an unsupported format. This PR passes 5/5. The validation layer was loaded and inserted for every test (checked withVK_LOADER_DEBUG=layer), there was no missing-layer warning, no skips, and noVUID-errors in either log.VUID-errors in either log.ctest -R "agc_driver_image|agc_driver_format|buffer_format|texture"passes 78/78, andpublic_headerspasses 65/65.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py: no confirmed overlap. The tool could not compare 77 open PRs that conflict withmain. None of their diffs addsFormat1_5_5_5UNorm, a 135 table entry,R5G5B5A1_UNORM_PACK16orGetImageFormatInfo.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
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T07:20:59Z.
Review: COMMENTED
Reviewed — no blocking findings in the code read; the 1_5_5_5 image tests have no hosted pass
This PR adds sampling and storing of
1_5_5_5 UNormimages: a format-135 entry in the texture format table, a helper that gives the image path its own format description, and the SPIR-V image emitter using it. I read the production change in full. The layout comes from a Mesa commit that the debt entry cites, and I did not check that commit. The Windows run selected 39 cases, and none of them is the image tests this PR changes.What I ran
61b7d9bcaaf56a4477df7d254884fe6fc94152c8; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. 13 files, +81/-16:Graphics/src/Texture.cpp,Graphics/src/TextureFormat.cpp(new format andGetImageFormatInfo),Optimization/src/ResourceMaterializer.cpp,RdnaDecoder/src/RdnaDescriptorFormat.cpp,SpirvBackend/include/SpirvBackend/SpirvBufferFormat.hpp,SpirvBackend/src/SpirvBufferFormat.cpp,SpirvBackend/src/SpirvImageEmitter.cpp, the image-test CMake fragment, four test sources, and two debt lines.ImageConvertedUnorm.cpp(+14/-),ImagePacked16Load.cpp(+49),TextureFormat.cpp(+3/-1).ImageConvertedUnorm,ImagePacked16Load).Results
ImageConvertedUnormorImagePacked16Loadappears in the 39-case runlibrary-portability(hosted)Read-only check output
Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. Stack check: passed, no declared dependencies, no errors. ABI audit: not applicable. Hosted:
gh api repos/boykopovar/AnyPS5/commits/61b7d9bcaaf56a4477df7d254884fe6fc94152c8/check-runs, and the Windows job log (39 of 39).Negative control
Not run here. A negative control needs a local build and run of the image tests, and code from this head is not run here.
Findings
Blocking
None from the code read.
Non-blocking
Sources
github.com/boykopovar/AnyPS5@61b7d9bcaa/core/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cppgithub.com/boykopovar/AnyPS5@61b7d9bcaa/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppgithub.com/boykopovar/AnyPS5@61b7d9bcaa/docs/dev/debt/libSceAgcDriver.mdwindowson 61b7d9bcaaf56a4477df7d254884fe6fc94152c8Not verified
ImageConvertedUnorm.cpp,ImagePacked16Load.cpp) and theTextureFormat.cpptest change.To get this to a good state
ImageConvertedUnormandImagePacked16Loadin hosted CI at this head. Nothing else blocking.