test(agc): export the front-face bits through a uint target as uint #7746
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7746"
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 YossiYad on 2026-10-19T05:50:26Z.
What
Refs #7703.
agc_driver_front_face_all_bitsbinds aVK_FORMAT_R32_UINTcolor target but drives the pixel export throughtargetOutputMode[0] = 1(SPI_SHADER_32_R) withuintExportleft clear, so the recompiler declaresout_mrt_0asfloat4. Writing a float output to an unsigned-integer attachment is undefined in Vulkan: the Khronos validation layer reportsUndefined-Value-ShaderFragmentOutputMismatchon every driver, and MoltenVK's Metal compiler refuses the pipeline (#7703). Desktop drivers keep the raw bits, so the behavioural check still passed and the mismatch went unseen in CI behaviour.The test now exports through mode 7 with
uintExportset, the path a real unsigned-integer target uses: the recompiler declaresout_mrt_0asuint4and the raw front-face bits reach theR32_UINTattachment as an unsigned integer. The pixel program exports component 0 only, so the readback values are unchanged. Test-only change; no driver source is touched.I also recorded in
docs/dev/debt/libSceAgcDriver.mdthat the export-format check inState.cpprefuses aUINT16_ABGRexport into a non-integer target but not the reverse, so a float export into an integer target is the same mismatch at the driver level.DecodeColorBuffermaps a number format of 4 toR32_UINTfrom the color buffer alone, so the combination is representable; which export format a title pairs with a 32-bit integer target is not measured, so I left the recompiler as is rather than change it speculatively here.Tested
Linux (Fedora 44, GCC, Ninja,
-DBUILD_TESTING=ON), RX 7700 XT (RADV NAVI32, Mesa), based onmain4ffb0cd12b:VK_LAYER_KHRONOS_validation1.4.34): onmainthe test prints twoUndefined-Value-ShaderFragmentOutputMismatchwarnings, one per draw, reporting a FLOAT output intoVK_FORMAT_R32_UINT; with this change both are gone. The 8 pre-existingVUID-VkGraphicsPipelineCreateInfo-pLibraries-06681errors are unrelated to color formats and are unchanged before and after.agc_driver_front_face_all_bits: passes 3 of 3 (--repeat until-fail:3) with and without the change; the readback values (0x3f800000/0xbf800000without all-bits,0xffffffff/0with it) are identical.tools/check_conventions.py --base upstream/mainandtools/pr_overlap.py --base main(no overlap) pass.Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T06:01:57Z.
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/debt/libSceAgcDriver.mdL213docs/dev/debt/libSceAgcDriver.mdL213docs/dev/debt/libSceAgcDriver.mdL213docs/dev/debt/libSceAgcDriver.mdL213Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/execution/FrontFaceAllBits.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdcore/libs/prx/libSceAgcDriver/tests/execution/FrontFaceAllBits.cppdocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mddocs/dev/debt/libSceAgcDriver.mdImported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-19T06:22:20Z.
Thanks, the test change looks right: with mode 7 and a uint export, the readback is raw dwords, so the all-bits checks still catch a real regression.
One small request: could you change "Fixes #7703" to "Refs #7703" in the description? This PR fixes the test, but the issue's follow-up case (a mode 1 export to a 32-bit UINT target still producing float4, State.cpp:1275) is still open in the driver, and your debt bullet records that. "Fixes" would close the issue on merge.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-19T09:00:40Z.
Review: COMMENTED
Apple GPU / MoltenVK run. This fixes the Metal side of #7703:
agc_driver_front_face_all_bitswas one of the base^agcfailures on Apple, and with this PR it passes. The full^agcsuite loses that failure and gains nothing from this PR.Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704. Head 3aded24f4, PR diff applied cleanly.
Tested: the tree is
maina373e85e5+ mugurc's macOS series (ci/macos-series-2) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plainmain(it doesn't build on macOS yet). Applied together in the same build: #7371, #7535, #7684, #7746 and #7759, plus a test-only patch that lets nine AGC fixtures load the Vulkan loader on macOS (branchjotitadev:fix/agc-tests-vulkan-loader-macos). Base on that tree: 40^agcfailures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704, plusagc_driver_pooled_buffer_rangeandagc_performance_overlay, which only run because of the loader patch.agc_driver_front_face_all_bitspasses 3 of 3 on both drivers.FrontFaceAllBits.cppreverted, it fails on both drivers. MoltenVK rejects the pipeline withoutput of type float4 is not compatible with a MTLPixelFormatR32Uint color attachment, the error from #7703.^agcsuite with the stack: the base failures minusagc_driver_front_face_all_bitson both drivers. The one new failure in that run,agc_driver_native_depth_clears, comes from #7371 / #7233 in the same build (it passes again with #7371 reverted). Nothing from this PR.GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-19T10:02:34Z.
@oneandonlydean done, the description now says "Refs #7703", so the issue stays open for the mode 1 export into a 32-bit UINT target.
@jotitadev thanks for the MoltenVK run, good to have the Metal side confirmed.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T14:40:56Z.
AMD and Intel Windows data:
agc_driver_front_face_all_bitspasses with this PR's mode 7uintExportpath on the proprietary drivers of an AMD RX 9070 XT and an Intel UHD 770.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head3aded24f4merged intomain85029a00f.agc_driver_front_face_all_bitsThe change only touches the test, so there is no separate run without it;
main's version of the test also passes on both GPUs, in one full-suite run each. These runs had no validation layer, so they don't check theUndefined-Value-ShaderFragmentOutputMismatchwarnings, only that the uint export keeps the readback the test expects on these two drivers.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-19T21:17:34Z.
Rebased onto current
main(head3bdd430a3,mainbf2c63f85). The only conflict was the debt bullet, wheremainadded three entries at the same spot indocs/dev/debt/libSceAgcDriver.md; I kept them and put this one after them. The test change is unchanged, andagc_driver_front_face_all_bitspasses 3 of 3 on RADV.@savvaniss thanks for the RX 9070 XT and UHD 770 runs on the Windows drivers.