fix(agc): keep legacy graphics push data inside its block #16413

Merged
lgqdaxia merged 4 commits from upstream-pr/16413 into main 2026-11-15 19:28:01 +00:00
lgqdaxia commented 2026-11-06 16:26:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by lgqdaxia on 2026-11-06T16:26:26Z.


What

Keep graphics stage allocation inside the active pipeline push block. Non-GPL stages share one 128-byte block and leave one DWORD for a present fragment stage; GPL stages retain separate pre-rasterization and fragment slots. Use the same remaining budget for preparation, materialization and draw-cache reuse, including reserved depth-remap words.

Reserve the stencil replay reference DWORD before choosing push-backed shader data. Spill the data to its storage binding when the remaining budget cannot hold both, and match prepared artifacts using the same decision. Add asset-free preparation, allocator, real draw and cache-refresh regressions at the capacity boundary.

Tested

Recorded Windows comparison: 7/7 focused CTests pass on 91b03f80e6; main 3bd88ca11933 fails the allocation/preparation and non-GPL draw boundaries as expected. The six Vulkan cases load the validation layer and have zero skips, VUIDs or synchronization errors.

14 November maintenance: merged main a525d57e84f1, retaining both graphics-test selectors (--push-constant-assembly and --stencil-ref-export). Every production edit and regression addition in this PR is preserved.

Windows validation and source pins — 6 November 2026

Paired Windows CTests with the same new regressions and main 3bd88ca11933fcc0a2315743af31b8be72d0a482 production files as the control: candidate passes all 7 selected tests; the control fails the allocator, prepared-stage and non-GPL stencil/draw boundaries as expected. The legacy draw check verifies a cache hit, the fragment color after 32 vertex user words, and refreshed fragment data. The fitting 124+4B and separate GPL slots remain covered.

The 6 Vulkan tests required Vulkan, disabled shader caching and loaded the Khronos validation instance/device layers. Candidate logs contain zero VUID and synchronization errors; no tests skip. The current-main legacy draw control fails its pixel assertion without a VUID; the previously observed VUID10069 is frozen-source game evidence only. The configured full test-registration audit passed. Latest main 492ed5c5fe5d476257ab52fa8e09cf7c343c8200 was checked statically: the eight production paths and related tests are unchanged.

ctest --test-dir build -V --no-tests=error -R "^agc_driver_(stencil_ref_export_push_budget|prepared_graphics|stencil_replay(_no_gpl)?|draw_cache_reuse(_off)?|depth_range_remap_draw)$"

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: NVIDIA GeForce RTX 3080 Laptop GPU, Windows driver 32.0.16.1074, Windows 11 Pro 10.0.26200
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5191080081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16413). Originally posted by [lgqdaxia](https://github.com/lgqdaxia) on 2026-11-06T16:26:26Z. --- ### What Keep graphics stage allocation inside the active pipeline push block. Non-GPL stages share one 128-byte block and leave one DWORD for a present fragment stage; GPL stages retain separate pre-rasterization and fragment slots. Use the same remaining budget for preparation, materialization and draw-cache reuse, including reserved depth-remap words. Reserve the stencil replay reference DWORD before choosing push-backed shader data. Spill the data to its storage binding when the remaining budget cannot hold both, and match prepared artifacts using the same decision. Add asset-free preparation, allocator, real draw and cache-refresh regressions at the capacity boundary. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Recorded Windows comparison: 7/7 focused CTests pass on `91b03f80e6`; main `3bd88ca11933` fails the allocation/preparation and non-GPL draw boundaries as expected. The six Vulkan cases load the validation layer and have zero skips, VUIDs or synchronization errors. 14 November maintenance: merged main `a525d57e84f1`, retaining both graphics-test selectors (`--push-constant-assembly` and `--stencil-ref-export`). Every production edit and regression addition in this PR is preserved. <details> <summary>Windows validation and source pins — 6 November 2026</summary> Paired Windows CTests with the same new regressions and main `3bd88ca11933fcc0a2315743af31b8be72d0a482` production files as the control: candidate passes all 7 selected tests; the control fails the allocator, prepared-stage and non-GPL stencil/draw boundaries as expected. The legacy draw check verifies a cache hit, the fragment color after 32 vertex user words, and refreshed fragment data. The fitting 124+4B and separate GPL slots remain covered. The 6 Vulkan tests required Vulkan, disabled shader caching and loaded the Khronos validation instance/device layers. Candidate logs contain zero VUID and synchronization errors; no tests skip. The current-main legacy draw control fails its pixel assertion without a VUID; the previously observed VUID10069 is frozen-source game evidence only. The configured full test-registration audit passed. Latest main `492ed5c5fe5d476257ab52fa8e09cf7c343c8200` was checked statically: the eight production paths and related tests are unchanged. `ctest --test-dir build -V --no-tests=error -R "^agc_driver_(stencil_ref_export_push_budget|prepared_graphics|stencil_replay(_no_gpl)?|draw_cache_reuse(_off)?|depth_range_remap_draw)$"` </details> ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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: NVIDIA GeForce RTX 3080 Laptop GPU, Windows driver 32.0.16.1074, Windows 11 Pro 10.0.26200 - [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!16413
No description provided.