fix(shader): keep direct VGPR accesses in SSA when the window has only relative reads #4120

Merged
tibzejoker merged 5 commits from upstream-pr/4120 into main 2026-10-13 01:47:40 +00:00
tibzejoker commented 2026-10-11 23:44:11 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-11T23:44:11Z.


What

On current main (bab7b3285) a shader that reads VGPRs relatively but spills a descriptor into a windowed VGPR fails to recompile:

ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(LoadVectorWindow(Immediate), Immediate)

Seen in GTA V (PPSA04264), pixel shader 0x25a889400, fatal at draw time.

When a program uses relative VGPR addressing, every register from the lowest relatively addressed one upward goes into the window array, so even direct accesses become LoadVectorWindow / StoreVectorWindow. A sampler dword written with v_writelane_b32 and read back with v_readlane_b32 then has no definition that resource analysis can follow.

When the program has no indexed writes (no v_movreld_b32, v_movrelsd_b32, v_movrelsd_2_b32 or v_swaprel_b32), only the relative reads need the window. With this change, direct reads and writes stay SSA registers, and each direct write is also stored into the window so the relative reads still see it. Programs with indexed writes keep the current path.

Files: ProgramMetadata.hpp (new vectorWindowIndexedWrites), InstructionTranslator.cpp (the existing window scan sets it), IrBuilderRegisters.cpp (GetVectorReg / SetVectorReg).

Test: new case in agc_vector_window_tests (tests/VectorWindow.cpp), "a sampler dword spilled into a relatively read register keeps its definition through v_readlane". It is a hand-assembled wave32 compute program: v_movrels_b32 v1, v4 (m0 = 2), v_writelane_b32 v4, s8, 0, v_readlane_b32 s8, v4, 0, image_sample_lz with T# s[0:7] and S# s[8:11], then a buffer_store of the result. On main it throws the error above. With this change it recompiles.

Related: #4057 also edits relative vector windows (window sizing from implicit inputs) and touches VectorWindow.cpp and InstructionTranslator.cpp. It is a different change, but the two may need a small rebase against each other.

Tested

Windows 11 x64, RTX 4090, WinLibs GCC 15.2.0 (MinGW), Release.

  • agc_vector_window_tests: fails on main with the GetSamplerResource error above, passes with the change (the two existing cases pass in both).
  • ctest -R "agc_driver|agc_masked|agc_shader|agc_vector" -j8 (344 tests) on main and with the change: same results. Failing in both: agc_driver_prepared_shaders_registered_workgroup_sync ("expected preparation failure") and 18 "Not Run" entries with no executable on this build. Under -j8, agc_driver and agc_driver_prepared_shaders_* sometimes exit with 0xc0000374 (heap corruption) on both main and the branch; they pass when run alone.
  • GTA V (PPSA04264): with the change, shader 0x25a889400 recompiles and the game runs past the draw that stopped on this error.
  • Note: building main on Windows with MinGW currently needs #4021 (libkernel Socket.cpp uses HostPoll outside #ifndef _WIN32). It is not part of this PR.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes (Claude Code); the diagnosis, fix and test were reviewed and run locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV

🤖 Generated with Claude Code

https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823280860 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-11T23:44:11Z. --- ### What On current main (bab7b3285) a shader that reads VGPRs relatively but spills a descriptor into a windowed VGPR fails to recompile: ``` ShaderRecompiler::Recompile: GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(LoadVectorWindow(Immediate), Immediate) ``` Seen in GTA V (PPSA04264), pixel shader 0x25a889400, fatal at draw time. When a program uses relative VGPR addressing, every register from the lowest relatively addressed one upward goes into the window array, so even direct accesses become LoadVectorWindow / StoreVectorWindow. A sampler dword written with v_writelane_b32 and read back with v_readlane_b32 then has no definition that resource analysis can follow. When the program has no indexed writes (no v_movreld_b32, v_movrelsd_b32, v_movrelsd_2_b32 or v_swaprel_b32), only the relative reads need the window. With this change, direct reads and writes stay SSA registers, and each direct write is also stored into the window so the relative reads still see it. Programs with indexed writes keep the current path. Files: ProgramMetadata.hpp (new `vectorWindowIndexedWrites`), InstructionTranslator.cpp (the existing window scan sets it), IrBuilderRegisters.cpp (GetVectorReg / SetVectorReg). Test: new case in `agc_vector_window_tests` (tests/VectorWindow.cpp), "a sampler dword spilled into a relatively read register keeps its definition through v_readlane". It is a hand-assembled wave32 compute program: v_movrels_b32 v1, v4 (m0 = 2), v_writelane_b32 v4, s8, 0, v_readlane_b32 s8, v4, 0, image_sample_lz with T# s[0:7] and S# s[8:11], then a buffer_store of the result. On main it throws the error above. With this change it recompiles. Related: #4057 also edits relative vector windows (window sizing from implicit inputs) and touches VectorWindow.cpp and InstructionTranslator.cpp. It is a different change, but the two may need a small rebase against each other. ### Tested Windows 11 x64, RTX 4090, WinLibs GCC 15.2.0 (MinGW), Release. - `agc_vector_window_tests`: fails on main with the GetSamplerResource error above, passes with the change (the two existing cases pass in both). - `ctest -R "agc_driver|agc_masked|agc_shader|agc_vector" -j8` (344 tests) on main and with the change: same results. Failing in both: `agc_driver_prepared_shaders_registered_workgroup_sync` ("expected preparation failure") and 18 "Not Run" entries with no executable on this build. Under -j8, `agc_driver` and `agc_driver_prepared_shaders_*` sometimes exit with 0xc0000374 (heap corruption) on both main and the branch; they pass when run alone. - GTA V (PPSA04264): with the change, shader 0x25a889400 recompiles and the game runs past the draw that stopped on this error. - Note: building main on Windows with MinGW currently needs #4021 (libkernel Socket.cpp uses `HostPoll` outside `#ifndef _WIN32`). It is not part of this PR. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes (Claude Code); the diagnosis, fix and test were reviewed and run locally. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01V1W4jdNSKTV7xwuS6xQPJV
Dextroid17 commented 2026-10-12 00:50:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T00:50:02Z.


The mechanism is the right shape for the bug described: when a program has no indexed writes, GetVectorReg/SetVectorReg keep direct accesses as SSA registers instead of routing them through the window, which is what lets resource analysis (GetSamplerResource) follow a direct v_writelane_b32/v_readlane_b32 pair. SetVectorReg still emits StoreVectorWindow for a windowed register before checking the new flag, so a relative read of that slot still sees the direct write — the window and the SSA register stay in sync on the write side; only the direct-read path diverges.

The flag is assigned only inside if (windowBase < vectorLimit) and defaults to false, but that is inert where it matters: vectorWindowIndex returns nullptr whenever vectorWindowSize == 0, and a program with no relative addressing never lowers windowBase below vectorLimit, so no window is built and neither GetVectorReg nor SetVectorReg consults the flag. The flag-set itself is right too: of the opcodes that lower the window base, v_movrelsd_b32/_2_b32 and v_swaprel_b32 all call writeRelativeVector and correctly set the flag true, while the one pure relative read, v_movrels_b32, is the opcode this PR targets and is correctly left out of the set.

The "programs with indexed writes keep the old path" branch is already exercised by the existing first case (it contains v_movreld_b32 and asserts the window is still built), and the body reports both existing cases pass on main and on the branch, so the new test adds the missing no-indexed-writes case rather than the only coverage of the window. One gap worth naming: the new case's assertion (functionArrays == 1) doesn't actually distinguish SSA-register routing from window routing — the window variable is allocated and StoreVectorWindow is emitted either way — so the case only proves recompilation doesn't throw, not that the direct read-back value is correct. An execution-level case that reads a directly written register back through v_movrels_b32 and checks the value would close that gap.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115796015 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6115796015). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T00:50:02Z. --- The mechanism is the right shape for the bug described: when a program has no indexed writes, GetVectorReg/SetVectorReg keep direct accesses as SSA registers instead of routing them through the window, which is what lets resource analysis (GetSamplerResource) follow a direct v_writelane_b32/v_readlane_b32 pair. SetVectorReg still emits StoreVectorWindow for a windowed register before checking the new flag, so a relative read of that slot still sees the direct write — the window and the SSA register stay in sync on the write side; only the direct-read path diverges. The flag is assigned only inside `if (windowBase < vectorLimit)` and defaults to false, but that is inert where it matters: `vectorWindowIndex` returns `nullptr` whenever `vectorWindowSize == 0`, and a program with no relative addressing never lowers `windowBase` below `vectorLimit`, so no window is built and neither `GetVectorReg` nor `SetVectorReg` consults the flag. The flag-set itself is right too: of the opcodes that lower the window base, `v_movrelsd_b32`/`_2_b32` and `v_swaprel_b32` all call `writeRelativeVector` and correctly set the flag true, while the one pure relative read, `v_movrels_b32`, is the opcode this PR targets and is correctly left out of the set. The "programs with indexed writes keep the old path" branch is already exercised by the existing first case (it contains `v_movreld_b32` and asserts the window is still built), and the body reports both existing cases pass on main and on the branch, so the new test adds the missing no-indexed-writes case rather than the only coverage of the window. One gap worth naming: the new case's assertion (`functionArrays == 1`) doesn't actually distinguish SSA-register routing from window routing — the window variable is allocated and `StoreVectorWindow` is emitted either way — so the case only proves recompilation doesn't throw, not that the direct read-back value is correct. An execution-level case that reads a directly written register back through `v_movrels_b32` and checks the value would close that gap. Written with AI assistance.
tibzejoker commented 2026-10-12 00:59:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-12T00:59:56Z.


Thanks, fair point: the shape assertion only showed that the recompile succeeds. I added an execution test, agc_driver_vector_window_direct_access_tests (tests/execution/VectorWindowDirectAccess.cpp), that runs on the GPU and checks every lane.

The program has only relative reads (v_movrels_b32, no v_movreld/v_movrelsd/v_swaprel), so it takes the new path: window v8..v24, direct accesses as SSA registers, direct writes mirrored into the window. It:

  • writes window registers directly in several ways: two VALU adds (v8, v9), a v_mov plus v_writelane_b32 of lane 3 (v10), a buffer load (v11), and a VALU add whose scalar operand is a v_readlane_b32 of the lane written by v_writelane (v12);
  • reads them back directly and through v_movrels_b32 with M0 = 0, 1, 2, 3, 4;
  • rewrites v9 directly after it has been read relatively, then reads it again through v_movrels_b32 with M0 = 1, so a stale window copy would show up;
  • reads a v_movrels_b32 result (v16) back through v_movrels_b32 with M0 = 8;
  • stores two v_readlane_b32 results as scalars: the lane written by v_writelane and one it did not touch.

All 14 values per lane are checked exactly, for wave32 and wave64.

Results:

  • On this branch the test passes. agc_vector_window_tests, agc_driver_relative_indexing_tests and agc_driver_scalar_relative_indexing_tests pass too.
  • On upstream/main (7a84b2226) it also passes. That is expected: main routes every access through the window, and the test checks that the new routing gives the same values, not that main is wrong.
  • To check that the test can fail, I locally removed the mirror store for direct writes when there are no indexed writes. The test then fails right away (wave32 lane 0 movrels_valu is 0x00000000, expected 0x00001001).

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115883387 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6115883387). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-12T00:59:56Z. --- Thanks, fair point: the shape assertion only showed that the recompile succeeds. I added an execution test, `agc_driver_vector_window_direct_access_tests` (tests/execution/VectorWindowDirectAccess.cpp), that runs on the GPU and checks every lane. The program has only relative reads (v_movrels_b32, no v_movreld/v_movrelsd/v_swaprel), so it takes the new path: window v8..v24, direct accesses as SSA registers, direct writes mirrored into the window. It: - writes window registers directly in several ways: two VALU adds (v8, v9), a v_mov plus v_writelane_b32 of lane 3 (v10), a buffer load (v11), and a VALU add whose scalar operand is a v_readlane_b32 of the lane written by v_writelane (v12); - reads them back directly and through v_movrels_b32 with M0 = 0, 1, 2, 3, 4; - rewrites v9 directly after it has been read relatively, then reads it again through v_movrels_b32 with M0 = 1, so a stale window copy would show up; - reads a v_movrels_b32 result (v16) back through v_movrels_b32 with M0 = 8; - stores two v_readlane_b32 results as scalars: the lane written by v_writelane and one it did not touch. All 14 values per lane are checked exactly, for wave32 and wave64. Results: - On this branch the test passes. agc_vector_window_tests, agc_driver_relative_indexing_tests and agc_driver_scalar_relative_indexing_tests pass too. - On upstream/main (7a84b2226) it also passes. That is expected: main routes every access through the window, and the test checks that the new routing gives the same values, not that main is wrong. - To check that the test can fail, I locally removed the mirror store for direct writes when there are no indexed writes. The test then fails right away (`wave32 lane 0 movrels_valu is 0x00000000, expected 0x00001001`). AI-assisted (Claude Code).
tibzejoker commented 2026-10-12 06:53:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-12T06:53:49Z.


Rebased on main d06c06565. Two test changes came with it:

  • agc_vector_window_stage_inputs (#4057) required that no register at or above the window base is ever written as an SSA value. This PR does exactly that on purpose for programs without indexed writes: the direct write still goes to the window, and a copy stays in SSA for direct reads. The assertion now allows such a write only when vectorWindowIndexedWrites is false, and it no longer counts as initialization, so the window store is still required for every stage input. Programs with indexed writes are checked as before.
  • The sampler fixture gets its own all-zero user data, because main's fixtures now put a buffer V# in s[0:3] and this fixture samples an image from s[0:7].

ctest -R "agc|shader": 433/433 on Windows, RTX 4090.

On overlap with #4213 (window store-to-load forwarding inside a block): I replayed the GTA V request this PR was made for (compute 0x25a889400) on main + #4213. It still fails with GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(WriteLane(..., LoadVectorWindow(Immediate))). With this PR it recompiles (128830 SPIR-V words). The code changes are independent; the only textual overlap is tests/VectorWindow.cpp, which #4213 also conflicts on with current main.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119288399 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6119288399). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-12T06:53:49Z. --- Rebased on main d06c06565. Two test changes came with it: - `agc_vector_window_stage_inputs` (#4057) required that no register at or above the window base is ever written as an SSA value. This PR does exactly that on purpose for programs without indexed writes: the direct write still goes to the window, and a copy stays in SSA for direct reads. The assertion now allows such a write only when `vectorWindowIndexedWrites` is false, and it no longer counts as initialization, so the window store is still required for every stage input. Programs with indexed writes are checked as before. - The sampler fixture gets its own all-zero user data, because main's fixtures now put a buffer V# in s[0:3] and this fixture samples an image from s[0:7]. `ctest -R "agc|shader"`: 433/433 on Windows, RTX 4090. On overlap with #4213 (window store-to-load forwarding inside a block): I replayed the GTA V request this PR was made for (compute 0x25a889400) on main + #4213. It still fails with `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(WriteLane(..., LoadVectorWindow(Immediate)))`. With this PR it recompiles (128830 SPIR-V words). The code changes are independent; the only textual overlap is `tests/VectorWindow.cpp`, which #4213 also conflicts on with current main. AI-assisted (Claude Code).
github-actions[bot] commented 2026-10-12 07:30:24 +00:00 (Migrated from github.com)

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


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
#4213 core/libs/prx/libSceAgcDriver/tests/VectorWindow.cpp L273
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119767076 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6119767076). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-12T07:30:24Z. --- <!-- 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 | |---|---|---|---| | #4213 | `core/libs/prx/libSceAgcDriver/tests/VectorWindow.cpp` [L273](https://github.com/boykopovar/AnyPS5/blob/0c3dc9ca2b0572cf4239a3c16de3a8a3ba6f8304/core/libs/prx/libSceAgcDriver/tests/VectorWindow.cpp#L273) | | |
Dextroid17 commented 2026-10-12 17:46:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T17:46:09Z.


The gap I named is closed, and it is a test CI will actually run. Read at 44ac15495 (the rebased head) — I read the file, I did not build the head here.

  • tests/execution/VectorWindowDirectAccess.cpp checks 14 named values per lane against a computed expectation, for wave32 (32 threads) and wave64 (64 threads). The message carries the pair it compared (… movrels_valu is 0x00000000, expected 0x00001001), so it is a read-back check rather than a shape check.
  • The case I asked for is in it: movrels_rewritten reads a register relatively after a direct rewrite, so a stale window copy shows up as the pre-rewrite value, and movrels_of_movrels_result reads a relative-read result back relatively — the chain resource analysis follows.
  • Your control targets the right line, and it fails in the right place: removing the mirror for direct writes leaves the direct reads correct (they are SSA) and the failure lands on movrels_valu, the relative read whose mirror was removed.
  • Registration, for a new execution test: the file sits under tests/execution/, which core/libs/prx/libSceAgcDriver/CMakeLists.txt:983 globs with CONFIGURE_DEPENDS, and the foreach at :1069 turns each into add_test with SKIP_RETURN_CODE 77 and flips EXCLUDE_FROM_ALL off. So this is a real ctest entry that CI builds and runs — worth knowing, because an execution test that never registers is invisible.
  • Agreed that it passes on main too: it is a routing-equivalence check against the window path, not a Red arm. The Red arm is the VectorWindow.cpp case (the GetSamplerResource throw), and that is in the head as well.

The VectorWindow.cpp change reads right too: Require(index < base || !program.Metadata().vectorWindowIndexedWrites, …) with if (index < base) stored[index] = true keeps the window store required for every stage input, so relaxing the assertion does not weaken #4057's check.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6129536333 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6129536333). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T17:46:09Z. --- **The gap I named is closed, and it is a test CI will actually run.** Read at `44ac15495` (the rebased head) — I read the file, I did not build the head here. - `tests/execution/VectorWindowDirectAccess.cpp` checks **14 named values per lane** against a computed expectation, for wave32 (32 threads) and wave64 (64 threads). The message carries the pair it compared (`… movrels_valu is 0x00000000, expected 0x00001001`), so it is a read-back check rather than a shape check. - The case I asked for is in it: `movrels_rewritten` reads a register relatively *after* a direct rewrite, so a stale window copy shows up as the pre-rewrite value, and `movrels_of_movrels_result` reads a relative-read result back relatively — the chain resource analysis follows. - Your control targets the right line, and it fails in the right place: removing the mirror for direct writes leaves the direct reads correct (they are SSA) and the failure lands on `movrels_valu`, the relative read whose mirror was removed. - **Registration, for a new execution test:** the file sits under `tests/execution/`, which `core/libs/prx/libSceAgcDriver/CMakeLists.txt:983` globs with `CONFIGURE_DEPENDS`, and the `foreach` at `:1069` turns each into `add_test` with `SKIP_RETURN_CODE 77` and flips `EXCLUDE_FROM_ALL` off. So this is a real ctest entry that CI builds and runs — worth knowing, because an execution test that never registers is invisible. - Agreed that it passes on `main` too: it is a routing-equivalence check against the window path, not a Red arm. The Red arm is the `VectorWindow.cpp` case (the `GetSamplerResource` throw), and that is in the head as well. The `VectorWindow.cpp` change reads right too: `Require(index < base || !program.Metadata().vectorWindowIndexedWrites, …)` with `if (index < base) stored[index] = true` keeps the window store required for every stage input, so relaxing the assertion does not weaken #4057's check. Written with AI assistance.
oneandonlydean commented 2026-10-13 01:19:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T01:19:54Z.


Rebased onto main and pushed one commit on top (d9c040739) so the full build passes. The Linux job failed two of the new tests; neither comes from #4150:

  • agc_vector_window: the Linux job builds with ANYPS5_ENABLE_SPIRV_TOOLS=ON, and the optimizer replaces a window that is only indexed by constants with scalars, so functionArrays == 1 was false (same on 44ac15495 alone; it passes with the option off). The sampler case now reads M0 from the thread group id (MoveM0GroupX, as the first case does). Without the fix it still throws GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(LoadVectorWindow(Immediate), Immediate).
  • agc_driver_vector_window_direct_access: llvmpipe has 8-lane subgroups (wave32 lane 8 readlane_other_lane is 0x0000e000, expected 0x00006000). The test now skips below 32 lanes, like ReadLane.cpp and WriteLane.cpp.

Linux, RTX 4090, SPIRV-Tools on: full ctest 1005 tests, 0 failed, 7 skipped for the device; agc_driver_relative_ancillary from #4150 passes. A 2D title we test with runs as on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135989912 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6135989912). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T01:19:54Z. --- Rebased onto main and pushed one commit on top (d9c040739) so the full build passes. The Linux job failed two of the new tests; neither comes from #4150: - `agc_vector_window`: the Linux job builds with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`, and the optimizer replaces a window that is only indexed by constants with scalars, so `functionArrays == 1` was false (same on 44ac15495 alone; it passes with the option off). The sampler case now reads M0 from the thread group id (`MoveM0GroupX`, as the first case does). Without the fix it still throws `GetSamplerResource dword 0 is not a valid runtime value; chain: ReadLane(LoadVectorWindow(Immediate), Immediate)`. - `agc_driver_vector_window_direct_access`: llvmpipe has 8-lane subgroups (`wave32 lane 8 readlane_other_lane is 0x0000e000, expected 0x00006000`). The test now skips below 32 lanes, like `ReadLane.cpp` and `WriteLane.cpp`. Linux, RTX 4090, SPIRV-Tools on: full ctest 1005 tests, 0 failed, 7 skipped for the device; `agc_driver_relative_ancillary` from #4150 passes. A 2D title we test with runs as on main.
tibzejoker commented 2026-10-13 01:23:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-13T01:23:33Z.


Thanks @oneandonlydean. Both changes look right to me.

Checked d9c040739 on Windows 11, RTX 4090, GCC 15.2.0 UCRT, Release: agc_vector_window, agc_driver_vector_window_direct_access and agc_vector_window_stage_inputs pass. The direct-access test runs there, since the subgroup size is 32.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136030532 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4120#issuecomment-6136030532). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-13T01:23:33Z. --- Thanks @oneandonlydean. Both changes look right to me. Checked d9c040739 on Windows 11, RTX 4090, GCC 15.2.0 UCRT, Release: `agc_vector_window`, `agc_driver_vector_window_direct_access` and `agc_vector_window_stage_inputs` pass. The direct-access test runs there, since the subgroup size is 32. AI-assisted (Claude Code).
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!4120
No description provided.