fix(agc): name preparation-failure shader dumps apart from dispatch captures #6134
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6134"
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 fdfawef324 on 2026-10-14T23:02:24Z.
What
With
APS5_DUMP_SHADERSset, a shader whose preparation fails is dumped byPrepareShaderWithDiagnosticsunder the sameshader_<address>.reqname that dispatch and draw captures use. The two kinds of file need different replays:PrepareRegistered) also carries placeholder user data (all zero) and only the code and shader-header memory.agc_shader_replay, or--materializefrom #5959) follows the zero user-data pointer into the SRT. The table-base read then misses the request memory andSrtWalker::EvaluateDescriptorSourcethrows, so the replay reports a walker failure that never happens in the game, where dispatch uses the real user data.--preparesucceeds on the same files.Driver::dumpRequestde-duplicated by address. Once a preparation failure had been dumped, a later dispatch or draw dump of the same shader was dropped, so the request that would have shown the real capture was never written.Changes:
Driver::dumpRequesttakes an optional file-name suffix.PrepareShaderWithDiagnosticspasses.prepare, so preparation failures are written asshader_<address>.prepare.req. Dispatch and draw dumps keep theirshader_<address>.reqname.agc_shader_replayusage text says that a.prepare.reqholds a request whose preparation failed before any resource capture, and that it should be replayed with--prepare.FailureCaptureintests/execution/PreparedShaders.cppexpects the.prepare.reqname and no plain.reqfrom a preparation failure. It then dumps a dispatch request for the same address and requiresshader_<address>.reqto be written with the serialized request.Known limit: a registration-time
.preparedump still suppresses a later at-use.preparedump of the same address, which would carry real user data. Both replay only with--prepare, so this PR leaves it as is.Tested
Windows Server 2025 (10.0.26100), NVIDIA GeForce RTX 3060 12 GB, driver 591.86, Vulkan 1.4.325. WinLibs MinGW-w64 GCC 15.2.0, Ninja, Release,
BUILD_TESTING=ON. Builtagc_driver_prepared_shaders_tests,libSceAgcDriverandagc_shader_replay. Based onmain6239ceffc.ctest -R '^agc_driver_prepared_shaders'(9 variants;FailureCaptureruns inagc_driver_prepared_shaders,_indirect,_uncachedand_debug):main's driver: those 4 variants fail with "enabled shader capture changed the diagnosed failure", because the failure namesshader_12345cafe.req. The other 5 pass.main80ccb9fb1and again after rebasing onto6239ceffc.agc_shader_replaywith no arguments prints the new usage text.The bug was found while replaying a corpus of dumps from a title: every request that failed in
SrtWalkerwas a registration-time preparation dump with zero user data and only code and header memory, and each one passed with--prepare. Those dumps are not attached or included.Not tested: Linux, macOS, a title run with this change.
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)--materializereplays dispatch captures; with this change a.prepare.reqcan be told apart and replayed with--prepareonly. #5959 and #4048 change the sameagc_shader_replayusage line, so whichever lands second rebases that one line.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T11:31:30Z.
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)core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppL69-70core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppL70core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderDiagnostics.cppL52, L54-56, L58Some 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.
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderDiagnostics.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderDiagnostics.cppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tests/execution/PreparedShaders.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cppcore/libs/prx/libSceAgcDriver/tools/ShaderReplay.cpp3rdparty/SPIRV-Headers3rdparty/SPIRV-Toolscore/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hppcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp