perf(agc): put the shader data, image table maps and BDA tables in resizable BAR memory #15570
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15570"
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 milescoviello on 2026-11-03T19:13:49Z.
What
#9712 moves draw snapshots, vertex copies and the draw upload ring to resizable BAR memory. The other buffers the CPU writes once per resource build, and every wave of the shaders binding them reads, stay in cached host memory:
addDataBuffer), read by every wave;ImageTableMap), several dependent loads per image sample;snapshotCopy,copyRegion).On an RTX 4070 Ti (driver 615.71.09, PCIe 4.0) a compute read benchmark of 16-byte loads gives (ms):
How
context.SnapshotProperties(), so it lands in BAR memory under #9712's rules, and in host memory otherwise.Allocation::deviceWords) for the reuse compare inMovedDispatchBuffers, which compared the buffer's bytes. Writable region copies, which the write-back diffs, stay in host memory. Index copies the CPU scans for the highest index stay in host memory, as in #9712.Tested
APS5_PROFILE_GPU=1 APS5_PROFILE_GPU_DRAWS=1), local stack, last 30 windows of each run. The same placement covered #9712's buffers too, so this is the combined effect:The GPU profile serializes every draw, so it shows what each shader pays for its reads. Without it, GoT's frame isn't bound by those reads. I'm finding the CPU cost behind the lower rate with an in-process sampler of the driver threads, comparing host and BAR runs, and this stays a draft until that's explained.
0918b0dc37:agc_bda_staging,agc_buffer_pool,agc_draw_inputs_copied,agc_draw_inputs_in_place,agc_draw_snapshot_cap,agc_draw_snapshot_epoch,agc_driver_bda_device,agc_driver_bda_span_reads,agc_driver_graphics,agc_driver_image_table,agc_driver_image_table_reuse,agc_driver_large_tracked_snapshot,agc_driver_partially_resident_snapshot,agc_driver_prepared_graphics:8ff4baf534and head4e93e34d8evs headVK_LOADER_DEBUG=layerfollows the rebase.Checklist
main; no other open PR implements the same functions (#9712 covers the snapshots, this PR the rest)NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T05:20:04Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change based on the prepared diff and the targeted source read; the author’s reported tests were not run during this review.
What I ran
d1c817f4f32816a19034b645b78bd3c514e73d96usingrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
GuestBufferMemory.cpp,ShaderResources.cpp,tests/Graphics.cpp, andtests/Recorder.cppwas excluded from the review bundle; targeted changed ranges in those files were read throughrepo_read.py. Other changed files were not individually read in full.files.jsonwas unavailable; the included/excluded file list was checked via the review folder listing.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T22:40:56Z.
Review: COMMENTED
The trial merge onto
c1601e56d5conflicts in the BAR context, draw, recorder, and shader-resource paths. Reconcile placement with #9712 before rerunning the production bindings. The allocation-failure cases should verify that both the intended BAR placement and the host fallback still expose the shader data and table bytes. A successful allocation alone cannot show that the upload’s visibility and fallback survived the move.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.