fix(agc): name the shader and V# when a draw is refused for a buffer descriptor type #5897

Merged
YossiYad merged 3 commits from upstream-pr/5897 into main 2026-10-14 23:13:33 +00:00
YossiYad commented 2026-10-14 15:03:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T15:03:29Z.


What

Stray (PPSA02101, #5894, and PPSA02100, #5879) stops in its opening cinematic on

[videoout] presentation failed: buffer descriptor uses an unsupported type

The message names neither the shader nor the descriptor. Both reporters had to add a local print at the throw in materializeTables to get them, and APS5_DUMP_SHADERS writes nothing for this case: draws dump a request only when preparation fails (PrepareShaderWithDiagnostics), and this throw comes later, while the draw's resources are captured. Compute dispatches already put compute shader 0x... and the dump path in front of the same errors.

  • materializeTables: the error names the buffer slot and the four V# words, e.g. buffer descriptor uses an unsupported type (buffer 0 V# 20722c00 c3800000 001dc13f a1b00fac), like the image interface error does with its T#.
  • Driver::materializeDrawStage: a failure in the stage's resource capture or materialization is rethrown as shader 0x<address> stage <n>: <reason>, the prefix PrepareShaderWithDiagnostics uses. With APS5_DUMP_SHADERS set, the stage's request is dumped and its path goes in the prefix too.
  • agc_driver_buffer_descriptor_runtime checks that the refused vector read names buffer 0 and its words.
  • New agc_driver_draw_unsupported_buffer_type: a draw whose pixel shader loads through a V# with Stray's word 3 (0xa1b00fac, type 2) fails with the pixel shader's address and stage and the V# words.

No behaviour changes: the same descriptors are refused as before, only the message is longer.

Title. I do not have Stray. With this PR the next report of #5894 or #5879 carries the shader address, the descriptor and, with APS5_DUMP_SHADERS=1, a .req dump without a local patch.

Tested

Linux (Bazzite 44, GCC 16.2.1, Ninja, Release, -DBUILD_TESTING=ON), RX 7700 XT (RADV), based on main 84b01f9cd:

  • Full build and ctest: 1140 of 1162 pass and 20 are skipped (the display tests, no display in that shell). agc_driver_tessellation segfaults on unchanged main here, and agc_host_import_sparse fails on main too (#5759 fixes that test).
  • agc_driver_draw_unsupported_buffer_type fails without the DrawCapture.cpp change (the message has no shader 0x... stage 5), and agc_driver_buffer_descriptor_runtime fails without the ResourceMaterializer.cpp change (no (buffer 0 V# ...)).
  • Under APS5_DUMP_SHADERS=1 the new test still passes and writes shader_<address>.req for the pixel shader.
  • tools/check_conventions.py --base upstream/main passes, and tools/pr_overlap.py reports no overlap. Windows and macOS were not built here.

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
  • No new third-party code
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none (diagnostics for PPSA02101 and PPSA02100)
  • GPUs tested: AMD RX 7700 XT (RADV)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4859916862 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5897). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-14T15:03:29Z. --- ### What Stray (PPSA02101, #5894, and PPSA02100, #5879) stops in its opening cinematic on ``` [videoout] presentation failed: buffer descriptor uses an unsupported type ``` The message names neither the shader nor the descriptor. Both reporters had to add a local print at the throw in `materializeTables` to get them, and `APS5_DUMP_SHADERS` writes nothing for this case: draws dump a request only when preparation fails (`PrepareShaderWithDiagnostics`), and this throw comes later, while the draw's resources are captured. Compute dispatches already put `compute shader 0x...` and the dump path in front of the same errors. - `materializeTables`: the error names the buffer slot and the four V# words, e.g. `buffer descriptor uses an unsupported type (buffer 0 V# 20722c00 c3800000 001dc13f a1b00fac)`, like the image interface error does with its T#. - `Driver::materializeDrawStage`: a failure in the stage's resource capture or materialization is rethrown as `shader 0x<address> stage <n>: <reason>`, the prefix `PrepareShaderWithDiagnostics` uses. With `APS5_DUMP_SHADERS` set, the stage's request is dumped and its path goes in the prefix too. - `agc_driver_buffer_descriptor_runtime` checks that the refused vector read names buffer 0 and its words. - New `agc_driver_draw_unsupported_buffer_type`: a draw whose pixel shader loads through a V# with Stray's word 3 (`0xa1b00fac`, type 2) fails with the pixel shader's address and stage and the V# words. No behaviour changes: the same descriptors are refused as before, only the message is longer. **Title.** I do not have Stray. With this PR the next report of #5894 or #5879 carries the shader address, the descriptor and, with `APS5_DUMP_SHADERS=1`, a `.req` dump without a local patch. ### Tested Linux (Bazzite 44, GCC 16.2.1, Ninja, Release, `-DBUILD_TESTING=ON`), RX 7700 XT (RADV), based on `main` `84b01f9cd`: - Full build and `ctest`: 1140 of 1162 pass and 20 are skipped (the display tests, no display in that shell). `agc_driver_tessellation` segfaults on unchanged `main` here, and `agc_host_import_sparse` fails on `main` too (#5759 fixes that test). - `agc_driver_draw_unsupported_buffer_type` fails without the `DrawCapture.cpp` change (the message has no `shader 0x... stage 5`), and `agc_driver_buffer_descriptor_runtime` fails without the `ResourceMaterializer.cpp` change (no `(buffer 0 V# ...)`). - Under `APS5_DUMP_SHADERS=1` the new test still passes and writes `shader_<address>.req` for the pixel shader. - `tools/check_conventions.py --base upstream/main` passes, and `tools/pr_overlap.py` reports no overlap. Windows and macOS were not built here. ### 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] No new third-party code - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none (diagnostics for PPSA02101 and PPSA02100) - [x] GPUs tested: AMD RX 7700 XT (RADV) - [x] AI-assisted: yes
YossiYad commented 2026-10-14 22:25:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by YossiYad on 2026-10-14T22:25:45Z.


@oneandonlydean rebased onto main b9d9ec605 (head 7af296130) after #6093. Its stageCapture.capture = capture sat on the line this PR wraps in try; it now follows the wrapped Materialize call, and the PR's changed lines are otherwise the same. #6093's stage data hits patch words into a cached result without materializing, so they don't reach this throw.

Full build and ctest here: 1188 of 1212 pass and 21 are skipped (display tests). agc_driver_tessellation, application_heap_lazy and agc_host_import_sparse fail on unchanged main here too. agc_driver_draw_unsupported_buffer_type, agc_driver_buffer_descriptor_runtime and agc_driver_draw_cache_reuse pass.

Since #5894 was closed as a duplicate: the Stray stop in #5879 throws from the capture call (shaderMemory.Capture(invocation), which materializes), so the wrapper covers both calls, and a run with this PR names the shader there.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6179873390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5897#issuecomment-6179873390). Originally posted by [YossiYad](https://github.com/YossiYad) on 2026-10-14T22:25:45Z. --- @oneandonlydean rebased onto `main` `b9d9ec605` (head `7af296130`) after #6093. Its `stageCapture.capture = capture` sat on the line this PR wraps in `try`; it now follows the wrapped `Materialize` call, and the PR's changed lines are otherwise the same. #6093's stage data hits patch words into a cached result without materializing, so they don't reach this throw. Full build and `ctest` here: 1188 of 1212 pass and 21 are skipped (display tests). `agc_driver_tessellation`, `application_heap_lazy` and `agc_host_import_sparse` fail on unchanged `main` here too. `agc_driver_draw_unsupported_buffer_type`, `agc_driver_buffer_descriptor_runtime` and `agc_driver_draw_cache_reuse` pass. Since #5894 was closed as a duplicate: the Stray stop in #5879 throws from the capture call (`shaderMemory.Capture(invocation)`, which materializes), so the wrapper covers both calls, and a run with this PR names the shader there.
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!5897
No description provided.