perf(agc): bind a vertex range under a pending GPU write in place where draw inputs are copied #20578
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20578"
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 SP4C3B4R-8 on 2026-11-15T10:17:51Z.
What
Where draw inputs are copied (NVIDIA's Windows driver,
DrawInputsInPlaceUsable), a vertex range that GPU work still writes was copied too:CopyDrawInputfirst lands the pending write (GuestMemory::FlushGpuWrites) and then copies the range on the CPU, at every draw that reads it. The in-place path already binds such a range ordered behind the write on the GPU (behindGpuWrite, used where inputs are in place), soInPlaceDrawInputnow takes that path there too:NotePendingRead.APS5_NO_BEHIND_INPUTS_IN_PLACEcopies those ranges as before, and so doesAPS5_NO_DRAW_INPUTS_IN_PLACE. The variable is listed indocs/dev/ENVIRONMENT.md.Tested
Windows 11 Pro, Ryzen 7 7800X3D, GeForce RTX 5070 Ti (NVIDIA 610.88), a retail 3D title launched straight into a level,
APS5_HOST_IMPORT_MIB=14336 APS5_TEXTURE_CACHE_MIB=3584, otherwise defaults (label readback store on),main78276498ecagainst this PR on the same base (onlylibSceAgcDriver.prxdiffers), runs alternated A B B A, 10 s intervals fromAPS5_TRACE_SUMMARY_EVERY=10after the level loaded:mainGraphics.Drawms per frame (draw committer)vertex_uploadmainThe lighter level has no vertex reads behind pending writes (
vertex_upload3.5 ms per frame on both). The same change has been in my local build of this title since early November with no visible differences in either level.Tests, same machine,
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R '^(agc_draw_inputs_in_place_driver|agc_owned_draw_inputs.*|agc_draw_inputs_in_place|agc_draw_inputs_copied|agc_draw_input_reuse|agc_vertex_input.*|agc_driver_native_msaa_vertex_input|agc_driver_prepared_shaders_abi_deferred_vertex_inputs)$' -V: 13/13 passed, noVUID-lines.agc_draw_inputs_copiednow also checks that, with inputs copied, a vertex range free of pending writes is still copied, an index range under a pending write is still copied, and a vertex range under a pending write is bound in place behind it with its read noted and released atSync. Negative control: withDraw.cppfrommainthe test fails witha vertex input under a pending GPU write was copied where draw inputs are copied, instead of being bound in place behind the write.tools/pr_overlap.py: #19445 (mine, large vertex ranges in place) and #20368 (small, rarely read inputs in place) change the same first line ofInPlaceDrawInput, and #20368 also the copied-input test intests/Recorder.cpp. The three conditions are independent (behind a pending write; large; small and rarely read); whichever lands first, I rebase this one onto it.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
https://claude.ai/code/session_01DuBfeX7nBanPGcc6DyPSXW
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-15T10:44:55Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the inspected implementation and its pending-read tracking support merging, while the added test source was not fully reviewed.
What I ran
Reviewed head
4218279d2efc97a37495ee2b90d0f9c80ba4eb29usingrepo_read.pyto inspect the prepared diff and targeted source ranges. I ran no build or tests; the test results in the PR description are author-reported.Results
Findings
Blocking
None identified in the inspected implementation.
Non-blocking
None.
Not verified
The changed test file
core/libs/prx/libSceAgcDriver/tests/Recorder.cppwas excluded as too large; its added lines were visible in the diff, but the full source and surrounding test setup were not inspected. No tests, build, hardware, or console behavior were run or confirmed.docs/dev/ENVIRONMENT.mdandcore/libs/prx/libSceAgcDriver/Graphics/src/Draw.cppwere read; the test file was not fully read.To get this to a good state
Nothing is required.