fix(agc): move periodic profiling writes off GPU workers #798
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/798"
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 nicolasabosch on 2026-10-06T02:44:51Z.
What
Periodic AGC profiling reports currently write to
stderron GPU queue and presentation threads, sometimes while holdingGuestMemory::GpuMutex. WithAPS5_PROFILE_DRAW=1, a slow diagnostic destination can delay submitting otherwise ready GPU work.Format and copy periodic profiling output into a bounded 4 MiB queue and write it from a separate thread. The writer batches output, drains accepted chunks on shutdown, propagates write failures, and explicitly reports dropped chunks if the destination falls behind. The capacity includes in-flight output. Existing report formats and profiling switches are retained; error and assertion reporting remains synchronous.
Tested
--repeat until-fail:3; all three PR checks passed.agc_profile_output,agc_register_command_tests,agc_shader_disk_cache,agc_write_tracking,agc_driver,agc_driver_pm4,agc_driver_graphics,agc_driver_flat_store,agc_driver_image_store_packed,agc_driver_lds_atomics.Known limits: another interactive run still timed out at frame 112 and switched to the CPU scaler. This PR removes measured diagnostic-output stalls, but does not claim to resolve every frame timeout, improve FPS, or eliminate Vulkan instance/device initialization cost. A pre-existing UCRT invalid-parameter diagnostic also occurs during startup and remains unchanged.
Checklist
main(b10f5701); no other open PR implements the same changeIn-game screenshots
Fresh captures from the final implementation in the separate DOOM integration. The interactive session ran for 213 seconds, completed more than 7,400 dispatches and reported no frame timeouts, CPU fallback or dropped profiling chunks.
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T03:28:22Z.
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/src/Driver/Draw/DrawCacheStatistics.cppL0-1, L15-17