feat(agc): load and store signed packed image formats #17623
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/17623"
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 johnohhh1 on 2026-11-09T03:43:51Z.
What
Adds direct image load/store support for signed packed formats 31/35/38/42/45/49:
11_11_10_SNORM/SINT,10_11_11_SNORM/SINTand2_10_10_10_SNORM/SINT, using this project's little-endian names. Views useR32_UINT; packed fields are sign-extended and use the existing typed-buffer normalization/store conversion, including D16 results and partial masks.Identifiers/layouts: AMD RDNA 1 ISA §8.2.8 Table 47 and Mesa gfx10 tables at 418c4cfa. Conversion uses the existing image-format and typed-buffer helpers. An RDNA2 comparison matched the tested loads for all six formats and stores for five. Exact half values for the 2-bit SNORM field of format 45 were the exception. RDNA2 results Sampling, gathers/LOD queries, image tables, packed accesses and a missing W selector remain refused; render targets and a title unblock are not claimed.
The November 25 refresh resolves five conflicts and preserves the merged format-131 support from #17701. All 103 upstream decoder rows remain in order, plus six signed rows.
The signed-image test fragment now explicitly registers format 31 under the existing
agc_driver_image_packed_signedname and configures all six cases together. Format 31 passes its argument directly. The six test names, timeouts, skip behavior, environment and working directory are unchanged. CMake reviewDraft/order hold. #25877 fixes 2-bit SNORM half rounding in the shared typed-buffer conversion. Ordering with the still-open #16260 also needs agreement. The table-count agreement is preserved.
Tested
Fresh
BUILD_TESTING=ONconfiguration and focused Release build pass atd3026eec157984de812051bc14047ac5d6dfbd92. CTest lists exactly six signed-format cases, with format 31 as the explicit argument to the unsuffixed test. The paired run used the same fixtures against frozen mainfbd2175e5c1a0bcde352b81b19a1cb45db3c7b47.The loader inserted Khronos validation 1.4.341 throughout. No VUIDs or skips. Hosted Windows CI for this head is pending.
Earlier rounding comparison. In a separate comparison, the RDNA2 half-rounding expectation and #25877's buffer fixture reproduced two failures on each device. With #25877 applied, those two cases passed, and the complete selection passed 19/19 on both devices with validation active and no VUIDs. The draft branch retains the standalone fixture while #25877 is under review. The result applies to the earlier tested integration.
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)Imported from boykopovar/AnyPS5. Originally posted by artor410 on 2026-11-19T12:24:46Z.
Review: APPROVED
Review of the code plus a Windows / NVIDIA Ampere run of the current head. I found no defects.
Windows run of
819b7d08f7Setup: Windows 11 Pro 10.0.26300, NVIDIA GeForce RTX 3070 Ti (
10de:2482, Ampere), driver 610.88, WinLibs GCC 15.2.0 r7, Release. The PR was merged ontomainfbaae8a79dwith--no-ff(clean merge). Runs usedANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1. The first run of each side also hadVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(SDK 1.4.363.0).These 17 tests are the same set as in your table:
agc_driver_image_packed_signedand_35/_38/_42/_45/_49,agc_driver_graphics, and the unsigned controlsimage_converted_unorm,image_load_packed,image_store_packed,image_packed16_*andimage_depth24*.mainplus only this PR's three test filesOn
main, the six signed tests stop withsampled image descriptor uses an unsupported format.agc_driver_graphicsstops withunsupported guest texture format 31. With the PR, each signed format printsload/store, D16, swizzle, clamps and guard checks passed, soCheckRefusals, including the sampling refusal, passes for the SINT codes too. The loader inserts the layer in the 16 tests that open a device (agc_driver_graphicsuses mocks). There were noVUID-messages and no missing-layer lines on either side.Code read
OpBitFieldSExtract, and SNORM then goes through the existingNormalizeFormatComponent. That maps a field tox / (2^(n-1) - 1)with the most negative code clamped to -1.0 and zero kept at +0. For the 2-bit field of2_10_10_10this gives -1, -1, 0 and 1 for codes -2 to 1.EmitFormatStoreComponent, which clamps to[-2^(n-1), 2^(n-1)-1]before masking ([-2, 1] for the 2-bit field).EmitD16StoreComponentsign-extends the 16-bit value first.GetImageFormatInforows that the merged buffer and unsigned image paths already use. I did not re-derive them from the ISA here.agc_driver_image_packed_signedruns the executable without an argument, which selects 31. All six are covered.Not covered: native AMD or PS5 measurement, sampling (which is still refused, as stated), and titles.
AI-assisted: yes (Claude Code). I ran the tests above and read the code at this head.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T12:38:20Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
819b7d08f7032b5bcf85b671c5079f2fb38a90eb. I did not run commands or tests; execution results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
Not verified
I read all eight changed files listed as
reviewedin the manifest:TextureFormat.cpp,TextureFormat.cpp(tests),agc_driver_image_packed_signed_tests.cmake,ImagePackedSigned.cpp,ResourceMaterializer.cpp,RdnaDescriptorFormat.hpp,RdnaDescriptorFormat.cpp, andSpirvImageEmitter.cpp; I also read the debt fragment. No changed files were excluded byfiles.json(that file was not available through the review reader). I did not run builds, tests, CI, console, or hardware checks. Claims about those runs and peer PR coordination were not independently verified.To get this to a good state
Nothing is required. Optional: obtain fresh hosted Windows CI for this head and retain the documented console measurement follow-up.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T06:10:52Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
CMake registers no test named
agc_driver_image_packed_signed, so configuring withBUILD_TESTINGenabled fails at the test properties call.What I ran
Reviewed head
1b8c079768a67e96eb5e7df023fbd1075c75e43fusing the prepared diff and repository reader. No build or tests were run.Results
Findings
Blocking
core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_image_packed_signed_tests.cmake:2sets properties onagc_driver_image_packed_signed, but this file registers only tests namedagc_driver_image_packed_signed_<format>at line 5. Repository search found no registration for the unsuffixed test name. With testing enabled,set_tests_propertiesnames an unknown test and causes CMake configuration to fail. Remove the unsuffixed property call or register the corresponding test.Non-blocking
None.
Not verified
No build, test suite, hardware behavior, or CI results were independently verified. The description reports Linux GPU test results and says fresh Windows CI is pending. All nine changed files listed in the manifest were included in the prepared diff; repository source was consulted for the CMake test name.
To get this to a good state
Register the unsuffixed test or remove the invalid property call, then rerun CMake configuration with
BUILD_TESTINGenabled and the relevant tests.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T13:03:03Z.
Review: COMMENTED
Reviewed — comments
The signed packed image change is inspected at head
d3026eec157984de812051bc14047ac5d6dfbd92; no concrete blocking defect was verified, but the stated draft/order hold and missing PS5 measurements prevent a formal approval.What I ran
Read the prepared diff and all ten changed files marked included in the manifest. No build or tests were run by me; the build and hardware results in the description are author-reported.
Results
Findings
Blocking
None verified.
Non-blocking
Not verified
I did not run the build or execution tests, inspect CI output, validate the external comparison, or verify behavior on PS5. No changed files were excluded by the manifest. The test and build results described in the PR were not independently run here.
To get this to a good state
Nothing is required for a code fix based on this review. The PR description identifies the outstanding dependency and ordering agreement as draft holds.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T17:03:13Z.
Review: COMMENTED
The added
agc_driver_image_packed_signedfixture passed on Linux/lavapipe. In the paired run,agc_driver_gcn_scalar_buffer_basepassed andagc_driver_image_tablehit its 30-second limit on both main at9d362fb088fcand this head. The Vulkan runs required the device, disabled the shader cache, and loaded Khronos validation 1.4.369. Neither side reported a missing layer or a VUID.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.