fix(agc): recapture and skip refused draws on the draw finisher #15455

Merged
Nesyth merged 3 commits from upstream-pr/15455 into main 2026-11-12 20:31:01 +00:00
Nesyth commented 2026-11-03 11:49:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Nesyth on 2026-11-03T11:49:11Z.


What

A draw finished on the draw finisher (APS5_DRAW_PIPELINE, #6946) handled two cases differently from the same draw finished on queue 0's worker. The capture check before the hand-off to the committer (capturedMemoryChanged) ran only on the worker, since its redo replays the draw from the worker's queue state. So a draw whose captured memory changed before that point was recorded with the old capture. With APS5_SKIP_REFUSED_DRAWS=1, a draw refused on the finisher stopped the driver instead of being skipped. The finisher now runs the check too, and on a change it captures the draw's stages again from the tail it already holds. A refused draw is reported and skipped as on the worker.

  • The second capture starts from the program memory, decodes the vertex stage infos again and uses a fresh capture memory, with no draw cache hit, exactly once (RecaptureScope), as the worker's redo does.
  • The fresh stages go into the draw cache next to the ones the first pass inserted; later lookups validate both against memory as before.
  • The finisher now compares the captured regions once per draw, which the worker already does for every draw it finishes itself.
  • The worker path is unchanged.
  • #10678 and #7369 edit the lines around the pipelined hand-off in finishDraw; the conflicts are textual.

Tested

Windows 11 Pro 26300, Radeon RX 7900 XTX (AMD Software 26.10.1), Ryzen 7 7800X3D, Release, MinGW-w64 GCC 15.2.

agc_driver_draw_recapture_on_change_finisher and agc_driver_draw_unsupported_buffer_type_skip_refused_finisher run the two existing tests with the finisher on. Removing the finisher's check, the restart before the second pass or the refused-draw catch makes the matching test fail.

  • The ^agc_ suite, 1290 tests, has the same two failures as main (agc_driver_direct_write_completion, agc_driver_sample_order_grid_reference). This holds with the finisher off and with APS5_DRAW_PIPELINE=1 set for every test.
  • The focused draw tests with the validation layer: 175 on main and 177 on this branch (the two finisher variants) pass. Both report the same 6 lines of VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605 and no missing layer.

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 (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • 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: AMD Radeon RX 7900 XTX, AMD Software 26.10.1 (32.0.32015.7029), Windows 11 Pro 26300
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5136708108 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15455). Originally posted by [Nesyth](https://github.com/Nesyth) on 2026-11-03T11:49:11Z. --- ### What A draw finished on the draw finisher (`APS5_DRAW_PIPELINE`, #6946) handled two cases differently from the same draw finished on queue 0's worker. The capture check before the hand-off to the committer (`capturedMemoryChanged`) ran only on the worker, since its redo replays the draw from the worker's queue state. So a draw whose captured memory changed before that point was recorded with the old capture. With `APS5_SKIP_REFUSED_DRAWS=1`, a draw refused on the finisher stopped the driver instead of being skipped. The finisher now runs the check too, and on a change it captures the draw's stages again from the tail it already holds. A refused draw is reported and skipped as on the worker. - The second capture starts from the program memory, decodes the vertex stage infos again and uses a fresh capture memory, with no draw cache hit, exactly once (`RecaptureScope`), as the worker's redo does. - The fresh stages go into the draw cache next to the ones the first pass inserted; later lookups validate both against memory as before. - The finisher now compares the captured regions once per draw, which the worker already does for every draw it finishes itself. - The worker path is unchanged. - #10678 and #7369 edit the lines around the pipelined hand-off in `finishDraw`; the conflicts are textual. ### Tested Windows 11 Pro 26300, Radeon RX 7900 XTX (AMD Software 26.10.1), Ryzen 7 7800X3D, Release, MinGW-w64 GCC 15.2. `agc_driver_draw_recapture_on_change_finisher` and `agc_driver_draw_unsupported_buffer_type_skip_refused_finisher` run the two existing tests with the finisher on. Removing the finisher's check, the restart before the second pass or the refused-draw catch makes the matching test fail. - The `^agc_` suite, 1290 tests, has the same two failures as `main` (`agc_driver_direct_write_completion`, `agc_driver_sample_order_grid_reference`). This holds with the finisher off and with `APS5_DRAW_PIPELINE=1` set for every test. - The focused draw tests with the validation layer: 175 on `main` and 177 on this branch (the two finisher variants) pass. Both report the same 6 lines of `VUID-VkPipelineColorBlendStateCreateInfo-pAttachments-00605` and no missing layer. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [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: AMD Radeon RX 7900 XTX, AMD Software 26.10.1 (32.0.32015.7029), Windows 11 Pro 26300 - [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!15455
No description provided.