fix(agc): prepare the null pixel program at draw when its variant was not prepared #1902

Merged
fisherjoey merged 2 commits from upstream-pr/1902 into main 2026-10-10 07:32:29 +00:00
fisherjoey commented 2026-10-08 23:11:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-08T23:11:06Z.


Closes #1901

What

The driver's null pixel program is prepared only in its registration variants (0 user SGPRs). A draw without a pixel program uses the queue's SPI_SHADER_PGM_RSRC2_PS user count and SPI_PS_IN_CONTROL wave bit for it. When those differ from the registration variant, SourceHandleFor and InvocationFor throw prepared shader artifact is missing for the requested static ABI.

The root cause, found by @Raghav314: since #1178 the two emplace calls at registration did nothing, so the null program was registered with the wrong inputs, and a null pixel draw took the last bound pixel shader's user SGPR count.

  • Registration moves into PrepareNullPixelProgram(device), which uses insert_or_assign for the program address, SPI_PS_INPUT_ENA/ADDR and RSRC2 (no user SGPRs).
  • A null pixel draw gets 0 user SGPRs (RSRC2 is not read) and an empty export mapping, so it matches the variant prepared at registration.
  • The unregistered compute path in both functions moves into PreparedAtUse. For the null program it prepares a variant at the draw only for wave32, which registration doesn't prepare. Every other miss still throws as before.
  • With #1836, PreparedAtUse returns snapshot.prepared->deferred for a registered shader, so a shader whose preparation #1836 deferred is still prepared at use.

Tested

Linux (Nobara 44, GCC), RTX 5070 Ti, NVIDIA 595.91.07.

d83e608e adds NullPixelMatchesRegistration to agc_driver_prepared_graphics: a null pixel draw with a previous shader's leftover state (4 user SGPRs, other inputs, a bound export mapping) must use the artifact prepared at registration. It fails without the fix and still fails with only part of it; it passes with all of it. ctest -R agc_: 248/248 on the RTX 5070 Ti and on RADV (Mesa 26.2.1). tools/check_conventions.py passes.

After the rebase onto main 00112489 (with #1836), built with ANYPS5_ENABLE_SPIRV_TOOLS=ON: agc_driver_prepared_graphics and agc_driver_prepared_shaders pass, and ctest -R agc_ -j1 passes 278 of 279 on the RTX 5070 Ti. The one failure, agc_driver_dcc_keys_first_write, also fails on plain main 00112489 on this GPU.

The earlier at-draw check and its results:

New check NullPixelAtDraw() in tests/execution/PreparedShaders.cpp. It prepares the registration variant of the null pixel program, then requests a wave32, 4 user SGPR fragment variant at push offset 20 / capacity 108.

ctest -R agc_driver_prepared_shaders
main 1be6f9f1 + the test only 4 of 5 fail with prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=32 pushOffset=20 pushCapacity=108 preparedLayouts= [0,128]. _debug_failure passes, as it expects a failure.
this branch 5/5 pass, and agc_driver_prepared_graphics passes too

Stray: without this change it aborts on the first such draw (above). With it, the log shows The null pixel program has no artifact for this draw (wave 64, 4 user SGPRs); preparing it at draw and the run continues to a later, unrelated error.

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 notes, investigation .md files or images added to the repository
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4793880873 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-08T23:11:06Z. --- Closes #1901 ### What The driver's null pixel program is prepared only in its registration variants (0 user SGPRs). A draw without a pixel program uses the queue's `SPI_SHADER_PGM_RSRC2_PS` user count and `SPI_PS_IN_CONTROL` wave bit for it. When those differ from the registration variant, `SourceHandleFor` and `InvocationFor` throw `prepared shader artifact is missing for the requested static ABI`. The root cause, found by @Raghav314: since #1178 the two `emplace` calls at registration did nothing, so the null program was registered with the wrong inputs, and a null pixel draw took the last bound pixel shader's user SGPR count. - Registration moves into `PrepareNullPixelProgram(device)`, which uses `insert_or_assign` for the program address, `SPI_PS_INPUT_ENA/ADDR` and RSRC2 (no user SGPRs). - A null pixel draw gets 0 user SGPRs (RSRC2 is not read) and an empty export mapping, so it matches the variant prepared at registration. - The unregistered compute path in both functions moves into `PreparedAtUse`. For the null program it prepares a variant at the draw only for wave32, which registration doesn't prepare. Every other miss still throws as before. - With #1836, `PreparedAtUse` returns `snapshot.prepared->deferred` for a registered shader, so a shader whose preparation #1836 deferred is still prepared at use. ### Tested Linux (Nobara 44, GCC), RTX 5070 Ti, NVIDIA 595.91.07. d83e608e adds `NullPixelMatchesRegistration` to `agc_driver_prepared_graphics`: a null pixel draw with a previous shader's leftover state (4 user SGPRs, other inputs, a bound export mapping) must use the artifact prepared at registration. It fails without the fix and still fails with only part of it; it passes with all of it. `ctest -R agc_`: 248/248 on the RTX 5070 Ti and on RADV (Mesa 26.2.1). `tools/check_conventions.py` passes. After the rebase onto `main` 00112489 (with #1836), built with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`: `agc_driver_prepared_graphics` and `agc_driver_prepared_shaders` pass, and `ctest -R agc_ -j1` passes 278 of 279 on the RTX 5070 Ti. The one failure, `agc_driver_dcc_keys_first_write`, also fails on plain `main` 00112489 on this GPU. The earlier at-draw check and its results: New check `NullPixelAtDraw()` in `tests/execution/PreparedShaders.cpp`. It prepares the registration variant of the null pixel program, then requests a wave32, 4 user SGPR fragment variant at push offset 20 / capacity 108. | | `ctest -R agc_driver_prepared_shaders` | |---|---| | `main` 1be6f9f1 + the test only | 4 of 5 fail with `prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=32 pushOffset=20 pushCapacity=108 preparedLayouts= [0,128]`. `_debug_failure` passes, as it expects a failure. | | this branch | 5/5 pass, and `agc_driver_prepared_graphics` passes too | Stray: without this change it aborts on the first such draw (above). With it, the log shows `The null pixel program has no artifact for this draw (wave 64, 4 user SGPRs); preparing it at draw` and the run continues to a later, unrelated error. ### 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 - [x] No notes, investigation `.md` files or images added to the repository - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Raghav314 commented 2026-10-09 07:42:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Raghav314 on 2026-10-09T07:42:55Z.


Hit this exact crash in Hades II (PPSA36082) and dug into why the null program misses in the first place. Two things:

  • Since #1178, SPI_PS_INPUT_ENA/ADDR are already in InitialContextRegisters, so the emplace(0x1b3u, 0x2u) / emplace(0x1b4u, 0x2u) in the null program's registration don't actually do anything. It gets prepared with inputs 0, but the draw asks for defaultPixelInputs (2). So every null pixel draw misses, not just the ones with odd leftover state.
  • The draw also gives the null program the user SGPR count of whatever pixel shader was bound last. The null program is just s_endpgm, so it shouldn't take any.

With insert_or_assign there and a user count of 0, the draw matches the variant from registration and nothing needs compiling at draw. That's enough for Hades. The leftover wave32 bit would still need handling the same way, which your PR already covers.

I've got this on a branch with a test that goes through the real registration path. Happy to share it if you want to use any of it here. Your call how you want to handle it.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6076682948 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6076682948). Originally posted by [Raghav314](https://github.com/Raghav314) on 2026-10-09T07:42:55Z. --- Hit this exact crash in Hades II (PPSA36082) and dug into why the null program misses in the first place. Two things: - Since #1178, SPI_PS_INPUT_ENA/ADDR are already in InitialContextRegisters, so the emplace(0x1b3u, 0x2u) / emplace(0x1b4u, 0x2u) in the null program's registration don't actually do anything. It gets prepared with inputs 0, but the draw asks for defaultPixelInputs (2). So every null pixel draw misses, not just the ones with odd leftover state. - The draw also gives the null program the user SGPR count of whatever pixel shader was bound last. The null program is just s_endpgm, so it shouldn't take any. With insert_or_assign there and a user count of 0, the draw matches the variant from registration and nothing needs compiling at draw. That's enough for Hades. The leftover wave32 bit would still need handling the same way, which your PR already covers. I've got this on a branch with a test that goes through the real registration path. Happy to share it if you want to use any of it here. Your call how you want to handle it.
EdouardSence commented 2026-10-09 08:05:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T08:05:47Z.


Astro Bot (PPSA21567) hits the case this PR fixes, and the next stop is a rect-list draw with the same null pixel program.

Setup: RX 9070 XT (RADV / Mesa 26.2.4), Linux. main a8b032b2 + #759 + #1836 + #1837 + CouchRiv's #1789 branch + this PR (fb6aefc2). The only conflict was with #1836 in ShaderRegistry.cpp. I kept your PreparedAtUse and made it return snapshot.prepared->deferred instead of false for registered shaders.

Without this PR: the run stops about 3 min in on prepared shader artifact is missing for the requested static ABI ... stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0].

With it: the log prints The null pixel program has no artifact for this draw (wave 64, 0 user SGPRs); preparing it at draw. The same frame then stops on:

AGC driver: prepared rectangle artifacts are missing

I added a local log in PreparedRectangle:

front=<vertex> deferred=0 entries=1 rects=2 fragments=1 vertexId=30a fragmentId=66d
  registered fragment: deferred=0 entries=2
  rectangles: (30a, 30b) (30a, 30c)

So the draw is a rect list that uses the null pixel program variant prepared at draw (66d). ResolvePreparedGraphics only builds rectangle pairs from the variants prepared at registration, so no pair exists for 66d. PreparedRectangle would need to build the missing pair the same way when a stage was prepared at use. I'm leaving that to you, since it extends this PR. Happy to run a candidate on this title.

Tested and written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077002338 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6077002338). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T08:05:47Z. --- Astro Bot (PPSA21567) hits the case this PR fixes, and the next stop is a rect-list draw with the same null pixel program. **Setup:** RX 9070 XT (RADV / Mesa 26.2.4), Linux. `main` a8b032b2 + #759 + #1836 + #1837 + CouchRiv's #1789 branch + this PR (fb6aefc2). The only conflict was with #1836 in `ShaderRegistry.cpp`. I kept your `PreparedAtUse` and made it return `snapshot.prepared->deferred` instead of `false` for registered shaders. **Without this PR:** the run stops about 3 min in on `prepared shader artifact is missing for the requested static ABI ... stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0]`. **With it:** the log prints `The null pixel program has no artifact for this draw (wave 64, 0 user SGPRs); preparing it at draw`. The same frame then stops on: ``` AGC driver: prepared rectangle artifacts are missing ``` I added a local log in `PreparedRectangle`: ``` front=<vertex> deferred=0 entries=1 rects=2 fragments=1 vertexId=30a fragmentId=66d registered fragment: deferred=0 entries=2 rectangles: (30a, 30b) (30a, 30c) ``` So the draw is a rect list that uses the null pixel program variant prepared at draw (`66d`). `ResolvePreparedGraphics` only builds rectangle pairs from the variants prepared at registration, so no pair exists for `66d`. `PreparedRectangle` would need to build the missing pair the same way when a stage was prepared at use. I'm leaving that to you, since it extends this PR. Happy to run a candidate on this title. *Tested and written by Claude (AI assistant) on a contributor's machine.*
XairRrR commented 2026-10-09 11:55:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-10-09T11:55:25Z.


Uncharted: Legacy of Thieves Collection (PPSA05684) hits the same miss for the null pixel program on main (a host address ending in 2700, stage 5, pushOffset=20 pushCapacity=108, prepared layouts [0,128] [0,0]). Like @Raghav314 found, the root cause was the emplace of SPI_PS_INPUT_ENA/ADDR doing nothing; locally I prepare the null program with insert_or_assign, no user SGPRs and an empty export mapping, so its registration variant matches the state its draws decode (a test that fails without it is in the branch below).

The title also misses for its own registered shaders, which this PR does not cover:

AGC driver: prepared shader artifact is missing for the requested static ABI: address=<0x1400010700, 0x1400011600, 0x1400026000> stage=5 wave=64 pushOffset=20 pushCapacity=108 preparedLayouts= [0,128] [0,0]

It links libSceAgc statically, so the driver's ABI-resolution hooks never see its state and registration cannot predict the variant (here the push-constant layout). Locally I prepare a registered shader's missing variant at the draw and keep it with the snapshot (with an error log line), which gets the title to its main menu. In terms of this PR, that is PreparedAtUse accepting registered snapshots too. Would you accept that generalization, here or as a follow-up on top of this PR? The branch is XairRrR:feat/agc-prepare-unpredicted-shaders.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6080349495 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6080349495). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-10-09T11:55:25Z. --- Uncharted: Legacy of Thieves Collection (PPSA05684) hits the same miss for the null pixel program on `main` (a host address ending in `2700`, stage 5, `pushOffset=20 pushCapacity=108`, prepared layouts `[0,128] [0,0]`). Like @Raghav314 found, the root cause was the `emplace` of `SPI_PS_INPUT_ENA/ADDR` doing nothing; locally I prepare the null program with `insert_or_assign`, no user SGPRs and an empty export mapping, so its registration variant matches the state its draws decode (a test that fails without it is in the branch below). The title also misses for its own registered shaders, which this PR does not cover: ``` AGC driver: prepared shader artifact is missing for the requested static ABI: address=<0x1400010700, 0x1400011600, 0x1400026000> stage=5 wave=64 pushOffset=20 pushCapacity=108 preparedLayouts= [0,128] [0,0] ``` It links libSceAgc statically, so the driver's ABI-resolution hooks never see its state and registration cannot predict the variant (here the push-constant layout). Locally I prepare a registered shader's missing variant at the draw and keep it with the snapshot (with an error log line), which gets the title to its main menu. In terms of this PR, that is `PreparedAtUse` accepting registered snapshots too. Would you accept that generalization, here or as a follow-up on top of this PR? The branch is [XairRrR:feat/agc-prepare-unpredicted-shaders](https://github.com/XairRrR/AnyPS5/tree/feat/agc-prepare-unpredicted-shaders).
orbz22 commented 2026-10-09 12:44:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by orbz22 on 2026-10-09T12:44:48Z.


Astro's Playroom (PPSA01325) hits this on Windows with NVIDIA.

Setup: main 745b775e + #1836 + #1837 + #1395 (rebased locally), plus a local workaround for vertex fetch exceeds descriptor record count (no PR yet).

  • Without this PR, the first draw with the null pixel program stops with:
    AGC driver: prepared shader artifact is missing for the requested static ABI: address=140710654621184 stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0]
    The address is 0x7ff9c095b600.
  • With this PR (fb6aefc2) it logs The null pixel program has no artifact for this draw (wave 64, 4 user SGPRs); preparing it at draw and goes on.
    • The 4 user SGPRs fit @Raghav314's point that the null program takes the user SGPR count of the last bound pixel shader.
    • The conflict with #1836 resolves the way @EdouardSence described above.
  • The next stop is #1928's rect-list case.

Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2.

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6081146179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6081146179). Originally posted by [orbz22](https://github.com/orbz22) on 2026-10-09T12:44:48Z. --- Astro's Playroom (PPSA01325) hits this on Windows with NVIDIA. Setup: `main` 745b775e + #1836 + #1837 + #1395 (rebased locally), plus a local workaround for `vertex fetch exceeds descriptor record count` (no PR yet). - Without this PR, the first draw with the null pixel program stops with: `AGC driver: prepared shader artifact is missing for the requested static ABI: address=140710654621184 stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0]` The address is 0x7ff9c095b600. - With this PR (fb6aefc2) it logs `The null pixel program has no artifact for this draw (wave 64, 4 user SGPRs); preparing it at draw` and goes on. - The 4 user SGPRs fit @Raghav314's point that the null program takes the user SGPR count of the last bound pixel shader. - The conflict with #1836 resolves the way @EdouardSence described above. - The next stop is #1928's rect-list case. Windows 11, RTX 3060 Laptop (NVIDIA 616.92), WinLibs GCC 15.2. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
NahuelGenchi commented 2026-10-09 14:47:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by NahuelGenchi on 2026-10-09T14:47:34Z.


Tested with Sonic Origins (PPSA05324) on Linux, R9 380 (RADV). Its depth/stencil clear draws have no pixel program, and the title uses three null pixel variants: wave 64 with 0, 4 and 16 user SGPRs. Without this PR the first one stops at prepared shader artifact is missing for the requested static ABI ... stage=5 wave=64 pushOffset=0 pushCapacity=128. With it, all three are prepared at draw. Then, with #1928 for their rect-list pairing, the clears run and the title presents its boot frames.

Bring-up thread: #2021

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6083266347 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6083266347). Originally posted by [NahuelGenchi](https://github.com/NahuelGenchi) on 2026-10-09T14:47:34Z. --- Tested with Sonic Origins (PPSA05324) on Linux, R9 380 (RADV). Its depth/stencil clear draws have no pixel program, and the title uses three null pixel variants: wave 64 with 0, 4 and 16 user SGPRs. Without this PR the first one stops at `prepared shader artifact is missing for the requested static ABI ... stage=5 wave=64 pushOffset=0 pushCapacity=128`. With it, all three are prepared at draw. Then, with #1928 for their rect-list pairing, the clears run and the title presents its boot frames. Bring-up thread: #2021
fisherjoey commented 2026-10-09 15:38:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-09T15:38:57Z.


Thanks, all. @Raghav314, that was the root cause. Since #1178 the two emplace calls did nothing, so the null program was registered with inputs 0 while every draw asked for 2. The user SGPR count was wrong too: it came from the last bound pixel shader, which matches orbz22's 4 and NahuelGenchi's 0/4/16 variants.

Fixed in d83e608e. Registration now uses insert_or_assign for the program address, SPI_PS_INPUT_ENA/ADDR and RSRC2 (no user SGPRs). A null pixel draw gets 0 user SGPRs and an empty export mapping, so it matches the registered variant. The at-draw path is now only for wave32, which registration doesn't prepare. The new check in agc_driver_prepared_graphics decodes a null pixel draw with a previous shader's leftover state (4 user SGPRs, other inputs, a bound export mapping) and requires the artifact prepared at registration. It fails on the previous head. ctest -R agc_ passes on an RTX 5070 Ti and on RADV.

I couldn't find your branch, so the test is mine. If you push yours, I'm happy to add it here with a Co-authored-by line.

@XairRrR, preparing registered shaders at draw is a bigger change than this PR. It decides when registered shaders compile, which oneandonlydean has asked boykopovar to rule on in #1836. I'd keep it as its own PR on top of this one.

@EdouardSence, once #1836 is in I'll rebase and return snapshot.prepared->deferred from PreparedAtUse, as you did.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6084149105 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6084149105). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-09T15:38:57Z. --- Thanks, all. @Raghav314, that was the root cause. Since #1178 the two `emplace` calls did nothing, so the null program was registered with inputs 0 while every draw asked for 2. The user SGPR count was wrong too: it came from the last bound pixel shader, which matches orbz22's 4 and NahuelGenchi's 0/4/16 variants. Fixed in d83e608e. Registration now uses `insert_or_assign` for the program address, `SPI_PS_INPUT_ENA/ADDR` and RSRC2 (no user SGPRs). A null pixel draw gets 0 user SGPRs and an empty export mapping, so it matches the registered variant. The at-draw path is now only for wave32, which registration doesn't prepare. The new check in `agc_driver_prepared_graphics` decodes a null pixel draw with a previous shader's leftover state (4 user SGPRs, other inputs, a bound export mapping) and requires the artifact prepared at registration. It fails on the previous head. `ctest -R agc_` passes on an RTX 5070 Ti and on RADV. I couldn't find your branch, so the test is mine. If you push yours, I'm happy to add it here with a Co-authored-by line. @XairRrR, preparing registered shaders at draw is a bigger change than this PR. It decides when registered shaders compile, which oneandonlydean has asked boykopovar to rule on in #1836. I'd keep it as its own PR on top of this one. @EdouardSence, once #1836 is in I'll rebase and return `snapshot.prepared->deferred` from `PreparedAtUse`, as you did. AI-assisted: yes
JAB-dev commented 2026-10-09 17:45:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-09T17:45:45Z.


Another title hitting #1901: Seeker: My Shadow (PPSA12500, Unity) stops with prepared shader artifact is missing for the requested static ABI ... pushOffset=68 pushCapacity=60 on the null pixel program. With this PR on top of #2169 it gets past it and keeps rendering.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086182350 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6086182350). Originally posted by [JAB-dev](https://github.com/JAB-dev) on 2026-10-09T17:45:45Z. --- Another title hitting #1901: Seeker: My Shadow (PPSA12500, Unity) stops with `prepared shader artifact is missing for the requested static ABI ... pushOffset=68 pushCapacity=60` on the null pixel program. With this PR on top of #2169 it gets past it and keeps rendering.
tv7 commented 2026-10-10 01:51:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-10T01:51:49Z.


Another title hitting #1901: Marvel's Wolverine (PPSA03671) on Windows.

Setup: Windows 11 Pro (10.0.26200), RTX 3070, GCC 15.2.0 UCRT (WinLibs), Release. This PR (d83e608e) merged onto main 54f28f2d3 with #1836, #1893, #1709, #1837, #1940, #2022, #2219, and a local change that lets sceKernelSignalSema accept a count of 0.

Without this PR: the first presentation fails with prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0].

With this PR: the null pixel draws pass. The next stop is AGC driver: prepared rectangle artifacts are missing (#1928).

Merge note: with #1836 also applied, SourceHandleFor and InvocationFor conflict. I resolved both as if (snapshot.prepared->deferred || PreparedAtUse(snapshot, request)), which keeps #1836's deferred shaders and this PR's at-draw path.

Limits: one title, one run each way.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6092384341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6092384341). Originally posted by [tv7](https://github.com/tv7) on 2026-10-10T01:51:49Z. --- Another title hitting #1901: Marvel's Wolverine (PPSA03671) on Windows. **Setup:** Windows 11 Pro (10.0.26200), RTX 3070, GCC 15.2.0 UCRT (WinLibs), Release. This PR (d83e608e) merged onto main 54f28f2d3 with #1836, #1893, #1709, #1837, #1940, #2022, #2219, and a local change that lets `sceKernelSignalSema` accept a count of 0. **Without this PR:** the first presentation fails with `prepared shader artifact is missing for the requested static ABI: ... stage=5 wave=64 pushOffset=0 pushCapacity=128 preparedLayouts= [0,128] [0,0]`. **With this PR:** the null pixel draws pass. The next stop is `AGC driver: prepared rectangle artifacts are missing` (#1928). **Merge note:** with #1836 also applied, `SourceHandleFor` and `InvocationFor` conflict. I resolved both as `if (snapshot.prepared->deferred || PreparedAtUse(snapshot, request))`, which keeps #1836's deferred shaders and this PR's at-draw path. **Limits:** one title, one run each way.
oneandonlydean commented 2026-10-10 05:17:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:17:07Z.


#1836 is merged, so this now conflicts in ShaderRegistry.cpp; could you rebase as planned (snapshot.prepared->deferred from PreparedAtUse)? It passed testing at d83e608e.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094130884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6094130884). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-10T05:17:07Z. --- #1836 is merged, so this now conflicts in `ShaderRegistry.cpp`; could you rebase as planned (`snapshot.prepared->deferred` from `PreparedAtUse`)? It passed testing at d83e608e.
fisherjoey commented 2026-10-10 05:57:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fisherjoey on 2026-10-10T05:57:11Z.


Rebased onto main 00112489 as planned. New head: 1140f636.

The only conflict was SourceHandleFor and InvocationFor in ShaderRegistry.cpp. Both now call if (PreparedAtUse(snapshot, request)), and PreparedAtUse returns snapshot.prepared->deferred for a registered shader, so #1836's deferred shaders are still prepared at use. An unregistered program still goes through the compute check as before. Nothing else changed.

Tested on an RTX 5070 Ti (NVIDIA 595.91.07), built with ANYPS5_ENABLE_SPIRV_TOOLS=ON: agc_driver_prepared_graphics and agc_driver_prepared_shaders pass, and ctest -R agc_ -j1 passes 278 of 279. The one failure, agc_driver_dcc_keys_first_write, also fails on plain main 00112489 on this GPU.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094421518 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6094421518). Originally posted by [fisherjoey](https://github.com/fisherjoey) on 2026-10-10T05:57:11Z. --- Rebased onto main 00112489 as planned. New head: 1140f636. The only conflict was `SourceHandleFor` and `InvocationFor` in `ShaderRegistry.cpp`. Both now call `if (PreparedAtUse(snapshot, request))`, and `PreparedAtUse` returns `snapshot.prepared->deferred` for a registered shader, so #1836's deferred shaders are still prepared at use. An unregistered program still goes through the compute check as before. Nothing else changed. Tested on an RTX 5070 Ti (NVIDIA 595.91.07), built with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`: `agc_driver_prepared_graphics` and `agc_driver_prepared_shaders` pass, and `ctest -R agc_ -j1` passes 278 of 279. The one failure, `agc_driver_dcc_keys_first_write`, also fails on plain main 00112489 on this GPU. AI-assisted: yes
adriadam10 commented 2026-10-10 07:10:20 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:10:20Z.


Rebased onto current main (conflicts with #2257 and #1836 in ShaderRegistry.cpp/.hpp, as Dean asked): SourceHandleFor and InvocationFor keep your PreparedAtUse and now call PrepareShaderWithDiagnostics; the header declares both ShaderPreparationContext and VulkanDevice. No other change.

Checked on the rebased head: build + ctest of libSceAgcDriver/libkernel scope, 380/380 passed (agc_driver_prepared_graphics, agc_driver_prepared_shaders included); merging on green CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094983164 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6094983164). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T07:10:20Z. --- Rebased onto current `main` (conflicts with #2257 and #1836 in `ShaderRegistry.cpp`/`.hpp`, as Dean asked): `SourceHandleFor` and `InvocationFor` keep your `PreparedAtUse` and now call `PrepareShaderWithDiagnostics`; the header declares both `ShaderPreparationContext` and `VulkanDevice`. No other change. Checked on the rebased head: build + ctest of libSceAgcDriver/libkernel scope, 380/380 passed (`agc_driver_prepared_graphics`, `agc_driver_prepared_shaders` included); merging on green CI.
github-actions[bot] commented 2026-10-10 07:11:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T07:11:33Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#1732 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp L37-39
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp L203-207, L257-261
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6094993342 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6094993342). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T07:11:33Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #1732 | `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp` [L37-39](https://github.com/boykopovar/AnyPS5/blob/e8b47b92709b4d29d1e6fc4bd47d047c8dba76c7/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawDecode.cpp#L37-L39)<br>`core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp` [L203-207](https://github.com/boykopovar/AnyPS5/blob/e8b47b92709b4d29d1e6fc4bd47d047c8dba76c7/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L203-L207), [L257-261](https://github.com/boykopovar/AnyPS5/blob/e8b47b92709b4d29d1e6fc4bd47d047c8dba76c7/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Shaders/ShaderRegistry.cpp#L257-L261) | | |
adriadam10 commented 2026-10-10 07:32:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T07:32:26Z.


CI re-run: the only red job was write-watch (macos-15-intel), write_watch_threads timing out at 30 s. This PR doesn't touch write-watch code, the other four write-watch tests and the macos-15 job pass, so it's a runner flake. Merging once the re-run is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6095150324 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1902#issuecomment-6095150324). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T07:32:26Z. --- CI re-run: the only red job was `write-watch (macos-15-intel)`, `write_watch_threads` timing out at 30 s. This PR doesn't touch write-watch code, the other four write-watch tests and the macos-15 job pass, so it's a runner flake. Merging once the re-run is green.
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!1902
No description provided.