perf(agc): finish GPU-indirect draws on the pipelined path #16993

Merged
oneandonlydean merged 1 commit from upstream-pr/16993 into main 2026-11-08 23:17:58 +00:00
oneandonlydean commented 2026-11-08 04:29:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-11-08T04:29:46Z.


What

Indirect draws that reach finishDraw on the pipelined path now take the same pipelined commit as direct draws, instead of the inline path with a drain. Queued draws also report their indirect argument range and count word as reads, so later writers order after them. This applies to every pipelined indirect draw (including multi-record and count-indirect ones), not only single-record ones; no new hand-off to the draw finisher is added. A guest CPU store into the arguments between enqueue and commit is not covered by the read registration; this is the same as for the index range already registered in that function. New test agc_driver_queued_indirect_read_order holds a pending image write over an indirect draw's arguments and, for a count-indirect draw, its count word, and checks the draw reads the old records; it fails on main (the draw holds no read of its arguments) and passes with this change.

Tested

Linux, RTX 4090, plain default config, no profile counters, warm shader cache, in-level window (the level runs ~3-5 fps on main at 6-15k draws per frame, so absolute fps is low). Paired alternating A/B against main 571cab9f71 (same base), 120 s arms, order AB then BA:

  • rocket_space_station: main 4.33 fps, this PR 5.32 fps (+23%)
  • big_hand_pirate_island: main 3.34, this PR 4.00 (+20%)
  • bumper_enemy_snowy_canyon: main 4.92, this PR 5.75 (+17%)
    An earlier 12-arm run with profile counters on showed the PR faster in 6 of 6 pairs (+17% to +30%). Host load varied between arms (1.4-10.9); pairs alternate but are not load-matched. Indirect/pipeline ctest subset 47/47; full AGC ctest 1324 of 1325, the one failure (agc_driver_image_gather_volume) fails identically on main. Frame 60 of rocket_space_station matches main by eye.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw; no silent stubs added
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 4090, Linux
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5208636057 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16993). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-11-08T04:29:46Z. --- ### What Indirect draws that reach `finishDraw` on the pipelined path now take the same pipelined commit as direct draws, instead of the inline path with a drain. Queued draws also report their indirect argument range and count word as reads, so later writers order after them. This applies to every pipelined indirect draw (including multi-record and count-indirect ones), not only single-record ones; no new hand-off to the draw finisher is added. A guest CPU store into the arguments between enqueue and commit is not covered by the read registration; this is the same as for the index range already registered in that function. New test `agc_driver_queued_indirect_read_order` holds a pending image write over an indirect draw's arguments and, for a count-indirect draw, its count word, and checks the draw reads the old records; it fails on main (the draw holds no read of its arguments) and passes with this change. ### Tested Linux, RTX 4090, plain default config, no profile counters, warm shader cache, in-level window (the level runs ~3-5 fps on main at 6-15k draws per frame, so absolute fps is low). Paired alternating A/B against main 571cab9f71 (same base), 120 s arms, order AB then BA: - rocket_space_station: main 4.33 fps, this PR 5.32 fps (+23%) - big_hand_pirate_island: main 3.34, this PR 4.00 (+20%) - bumper_enemy_snowy_canyon: main 4.92, this PR 5.75 (+17%) An earlier 12-arm run with profile counters on showed the PR faster in 6 of 6 pairs (+17% to +30%). Host load varied between arms (1.4-10.9); pairs alternate but are not load-matched. Indirect/pipeline ctest subset 47/47; full AGC ctest 1324 of 1325, the one failure (agc_driver_image_gather_volume) fails identically on main. Frame 60 of rocket_space_station matches main by eye. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw; no silent stubs added - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 4090, Linux - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!16993
No description provided.