feat(agc): map scaled guest texture formats to native Vulkan formats #14709
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14709"
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 akkadbakkad89 on 2026-11-01T17:13:57Z.
What
Adds native Vulkan host mappings for the 14 scaled guest texture formats whose layouts are bit-exact
Also renames guest buffer format 131 in
BufferFormat.hpptoFormat6E4Floatto match Mesa'sGFX10_FORMAT_6E4_FLOAT(the oldFormat10_10_10_2Floatname implied the wrong layout; the enumerator is unreferenced today — name-only change, flagged in review) —R8/R16/R8G8/R16G16/R8G8B8A8/R16G16B16A16_{U,S}SCALED(guest 3/4, 9/10, 16/17, 25/26, 58/59, 67/68) andA2B10G10R10_{U,S}SCALED_PACK32(guest 52/53) — and marks themsampledinkFormatInfoTable. The recompiler already models these throughUscaled/Sscaledcomponent types and buffer format info; only the host lookup and sampled flag were missing. Progress: sampled 81 to 95, Vulkan host format 68 to 82 of 159.2_10_10_10variants are intentionally unmapped — their 2-bit field sits at the least-significant end, unlike VulkanA2*formats. The test's rejection sentinel moves to the still-unnamed format 78.Tested
Windows 11, MinGW:
agc_driver_graphics_testspasses onmainand on this branch underANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. New assertions cover native resolve,FindGuestTextureFormatreverse lookup and the uint32/sint32 numeric classes; neither log containswas not found but was requestedand the change adds noVUID-lines.tools/shader_scan.py: sampled 81 to 95, host format 68 to 82.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 MarcZX10 on 2026-11-01T17:17:36Z.
Review: COMMENTED
Reviewed — no blocking findings
The 14 scaled-format mappings and their reverse-lookup and sampled-class assertions match the declared guest formats; approval is deferred while hosted checks are queued.
What I ran
Reviewed head
03822e06fe6bf289af5921153683e6a5ad63c2f3. The stack checker previewed it cleanly against basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0; no C++ build was run.Results
Check commands and unedited output
Negative control
Not run: the changed C++ assertions require an exact-head test binary, and no build was run.
Findings
Blocking
None found in the reviewed diff.
Non-blocking
Approval is deferred until the required hosted checks finish. The precheck's ABI and test-quality helper failures are environmental: those optional scripts are absent from the detached PR snapshot, so they did not evaluate this change.
Sources
Not verified
To get this to a good state
Let the queued CI checks finish. I will rerun the same no-build checks against the exact head if it changes and reassess after CI completes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T20:43:16Z.
Review: COMMENTED
Reviewed — no blocking findings
The 14 scaled guest formats now map to native Vulkan formats, and they are sampled only when the host reports sampled-image support for them. The hosted Windows job passed all 2594 CTest cases at this head, but the default graphics run that contains the new texture-format assertions does not appear by name in that log, so those assertions are not confirmed hosted. Approval waits for the macOS relinker jobs, which were queued at review time.
What I ran
999179d6551e464eb56fded9c2c31654e3659cdc; basef2d874c1fdccf781c0fa5d86619bb5dd8894b958. main is now5bae1a4bc2; the live stack check passed. 6 files, +101/-2.VulkanDevice.cpp(state,ScaledSampledFormatscall, context copy),Context.hpp,TextureFormat.hppandTextureFormat.cpp(lookup entries,kScaledTextureFormats,ScaledSampledFormats, the guard inSampledTextureFormat),RdnaDescriptorFormat.cpp, and the test file.std::array<FormatInfo, 96>. Lookup is by search, not by index, so order does not matter. The enum names used (for exampleFormat8UScaled = 3,Format8SScaled = 4,Format8_8SScaled = 17,Format16_16SScaled = 26) exist inBufferFormat.hpp.kScaledTextureFormats, and the two lists agree.SampledTextureFormatnow requires the host bit incontext.scaledSampledFormats, which is set fromScaledSampledFormatsat device creation. Storage paths go throughStorageFormatOrUndefined, which already refuses unsupported formats.MultisampleTarget.cppline 1325 usesSampledTextureFormatfor non-repacked formats.TextureFormat.cppis listed intests/cmake/agc_driver_graphics_tests.cmake.texture_format_lookuppassed (a separate binary). Many Vulkan-gated graphics cases were skipped on that runner. I could not match the defaultagc_driver_graphics_testsrun by name in the log.Results
TextureFormat.cpp)SampledTextureFormatrequires the host bit set fromScaledSampledFormatsRdnaDescriptorFormat.cpp)agc_driver_graphics_tests.cmake; the precheck heuristic flag is a false positiveCommands and unedited precheck output
Commands:
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 14709 --output-dir <scratch>/precheck/14709p(report.md in that directory).git fetch https://github.com/boykopovar/AnyPS5.git pull/14709/head.python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 999179d6551e464eb56fded9c2c31654e3659cdc --json(status not_applicable, 0 symbols with findings) andpython3 tools/pr_test_quality.py --root <archive of TextureFormat.cpp at the head> --json core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp(one possible-unregistered-cpp-test finding, a false positive).gh api repos/boykopovar/AnyPS5/commits/999179d6551e464eb56fded9c2c31654e3659cdc/check-runs; Windows log: the windows job of that run (CTest summary at the end of the log).Precheck table (unedited):
The precheck deliberately does not configure, build, or compile AnyPS5.git diff --check f2d874c1fdccf781c0fa5d86619bb5dd8894b958...999179d6551e464eb56fded9c2c31654e3659cdc/marc/DeusMachina_0x1914/.venv/bin/python3 tools/check_conventions.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 999179d6551e464eb56fded9c2c31654e3659cdc --title feat(agc): map scaled guest texture formats to native Vulkan formats --body /dev/shm/reviewer-run/precheck/14709p/pr-body.md/marc/DeusMachina_0x1914/.venv/bin/python3 tools/pr_abi_audit.py --base f2d874c1fdccf781c0fa5d86619bb5dd8894b958 --head 999179d6551e464eb56fded9c2c31654e3659cdc --jsonNo changed Python implementation files.No changed tools/ module has an existing sibling tools/tests/test_<module>.py suite.No changed test_*.py files./marc/DeusMachina_0x1914/.venv/bin/python3 /marc/AnyPS5/tools/pr_stack_check.py 14709 --repo boykopovar/AnyPS5 --output-dir /dev/shm/reviewer-run/precheck/14709p/stackNot run: C++ tests need exact-head binaries, which require a build; the precheck does not build./marc/DeusMachina_0x1914/.venv/bin/python3 /dev/shm/reviewer-run/precheck/14709p/head-999179d6551e-24a8a2f8/tools/pr_test_quality.py --root /dev/shm/reviewer-run/precheck/14709p/head-999179d6551e-24a8a2f8 --json core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp core/libs/prx/libSceAgcDriver/Graphics/include/Context.hpp core/libs/prx/libSceAgcDriver/Graphics/include/TextureFormat.hpp core/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cpp core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp core/shader/recompiler/RdnaDecoder/src/RdnaDescriptorFormat.cppNo changed Python test module in tools/ can be run as a no-build base-source control.Negative control
Not run here. The new assertions need a build; the PR body reports a local Windows run with Vulkan validation, which I did not reproduce.
Findings
Blocking
None.
Non-blocking
agc_driver_graphics_testsrun, which reachesRunTextureFormatTeststhroughGraphics.cpp(line 13269), does not appear by name in the hosted log. Please confirm that run is in the hosted set, or give its output for this head, so the new assertions are confirmed on the runner.ResolveTextureFormatnow returns the native formats for every caller. The sampled and storage paths check the host. SeveralDepthSurface.cppcallers (lines 52, 211, 462 and 2800) use the resolved format without that check. The comparisons at lines 446, 619 and 2939 reject it because they compare against depth formats; I did not trace the other four call sites. Please confirm they reject scaled formats or gate them.Sources
github.com/boykopovar/AnyPS5@999179d655/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp (L1336)and #L4342github.com/boykopovar/AnyPS5@999179d655/core/libs/prx/libSceAgcDriver/Graphics/src/TextureFormat.cpp (L137-L173)github.com/boykopovar/AnyPS5@999179d655/core/shader/recompiler/RdnaDecoder/src/RdnaDescriptorFormat.cpp (L17)github.com/boykopovar/AnyPS5@999179d655/core/libs/prx/libSceAgcDriver/tests/TextureFormat.cpp (L90-L121)github.com/boykopovar/AnyPS5@999179d655/core/libs/prx/libSceAgcDriver/tests/Graphics.cpp (L13269)Not verified
To get this to a good state