fix(agc): keep one trace thread pointer and recording flag across modules #7336
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7336"
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 thuanquang on 2026-10-18T00:51:18Z.
What
agc_driver_registration_trace, added by #7293, fails on Windows on every run witha title thread that registered a shader has no trace buffer.PerformanceTracekept the recording flag and each thread's trace buffer pointer asinline staticmembers in the header, andRecording()andThread()read them inline. On Linux, the copies in every module that includes the header resolve to one definition. A Windows DLL and an executable each get their own. The driver bound the registering thread's buffer inlibSceAgcDriver.prx's copy, while the test read the executable's copy, which stays empty.The same split cuts
libSceVideoOut.prxoff from tracing on Windows. ItsPerformanceTimers (VideoOut.Readiness,VideoOut.Flip) read libSceVideoOut's own copies of the flag and the pointer, and nothing ever sets those.The two members are now defined once, in a small
PerformanceTraceThread.cppin the driver.Recording()andThread()stay inline, but they now read the two throughextern "C"AgcDriverTraceRecording_nid_postfixandAgcDriverTraceThread_nid_postfix, so every module reads the driver's state. They are_nid_postfixfunctions, like libSceVideoOut's other calls into the driver. A first version with out-of-line static member functions made the patched libSceVideoOut.prx fail to load (patched_libraries:libSceVideoOut.prx: LoadLibraryEx failed with error 127).The definitions are not in
PerformanceTrace.cppbecause two test executables compileGuestMemory.cppwithout the driver (agc_shader_memory_tests,agc_write_tracking_tests), andPerformanceTrace.cppwould pull in the Vulkan device. Those two now compile the new file too. On Linux the copies were already one, so nothing changes there.Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,ANYPS5_REQUIRE_VULKAN=1:agc_driver_registration_tracefails 3 of 3 onmaina8581d333witha title thread that registered a shader has no trace buffer. With this change it passes, and so doesagc_driver_registration_trace_disabled.patched_librariestests (38) pass.ctest --parallel 4 --timeout 120onmaina8581d333with this change: 1435 tests. Onlyagc_driver_lds_mixed_width_atomics(#5271, fixed by #6976) andagc_driver_layered_volume_vertex_no_gpl(#4768) fail, as onmainhere, whereagc_driver_registration_tracefails too.python tools/check_conventions.py --base origin/mainwith this title and body passes.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 github-actions[bot] on 2026-10-18T01:10:35Z.
Some 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/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txt