fix(shader): keep cube modes for computed texel offsets without maintenance8 #28780

Open
GiannisG1 wants to merge 3 commits from upstream-pr/28780 into main
GiannisG1 commented 2026-12-03 15:52:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by GiannisG1 on 2026-12-03T15:52:12Z.


What

#23498 drops the texel offset of a sample or gather through a cube T#, as RDNA2 does. On a device without VK_KHR_maintenance8 (for example Mesa 25.2.8's ANV on an Intel HD Graphics 630), its test agc_driver_image_sample_cube_offset still fails before it runs:

ShaderRecompiler::Recompile: SPIR-V emission failed: hash=… stage=4 opcode=ImageSampleRaw reason=has a texel offset that is not a constant, which image sampling takes only with VK_KHR_maintenance8 and shaderImageGatherExtended

Without native non-constant offsets, ApplyStaticInterface marks an image sampled with a computed offset foldTexelOffsetsOnly, and RuntimeImageModes keeps only the modes an unnormalized S# can sample. That removes the cube modes, the only modes where the offset is dropped. The 2D modes left over cannot take the offset either when the S# cannot fold it into the coordinates (here the same S# serves a gather), so emission fails, although the T# is a cube and the offset would be ignored.

This PR:

  • keeps the cube modes of a foldTexelOffsetsOnly image;
  • marks the image cubeTexelOffsetsOnly when its S# cannot fold offsets (FoldsTexelOffsets, decided in ShaderInfoCollector once the sampler uses are collected), and then keeps only the cube modes. Any other T# is refused when its mode is selected (… takes only cube images, whose texel offsets RDNA2 ignores, without VK_KHR_maintenance8 and shaderImageGatherExtended), instead of the whole shader failing to recompile. An image without a cube mode keeps the modes it had;
  • lets a normalized S# with folded offsets pass DescriptorBindingBuilder when every image it samples takes a cube mode. Any other normalized S# is refused as before;
  • stores the new flag in the shader cache (format 99).

Nothing changes on a device with VK_KHR_maintenance8, where foldTexelOffsetsOnly is never set. The Linux CI job's llvmpipe has it, so it never took this path. agc_driver_image_sample_cube_offset now also runs with nonConstantImageOffsets forced off, so every device, CI's included, covers it.

Tested

Linux Mint 22.3, kernel 7.0.0, main cde48b5800, SPIRV-Tools on (as the Linux CI job builds).

  • RED with main's recompiler sources and the new tests: agc_driver_image_sample_cube_offset fails on the HD 630 in its native pass and on llvmpipe in the pass without VK_KHR_maintenance8, both with the emission message above. agc_shader_memory fails on the new cube case with normalized guest sampler is used with a texel offset that is not a constant. agc_shader_disk_cache does not compile without the new field.
  • GREEN: agc_shader_memory, agc_shader_disk_cache, agc_driver_image_sample_cube_offset, agc_driver_image_sample_derivatives, agc_driver_image_gather*, agc_driver_emulated_color_compare, agc_driver_prepared_shaders and agc_driver_image_plane_offset_on_line, 3/3 on the GTX 1050 Ti, the HD 630, llvmpipe (Mesa 25.2.8) and lavapipe 26.0.8. The only failure is agc_driver_image_plane_offset_on_line on the HD 630, which also fails on main and needs VK_KHR_maintenance8 for a normalized S# (#28744 skips it there). With the validation layer from Vulkan SDK 1.4.363.1, one more run on each device logged nothing.
  • Split suite (all tests once, GPU tests on all three GPUs) against our --full run of main cde48b5800: the GTX 1050 Ti fails nothing. On the HD 630, agc_driver_image_sample_cube_offset now passes, and every other failure is one main has on this machine. On llvmpipe, the failures are main's, except agc_driver_msaa_resolve_publication_order, which failed in main's run and passed here.
  • The source-scanning tests (conventions, public_headers, tools_): 162/162. check_conventions.py, check_test_registration.py, check_compile.py (7 translation units), check_main_sync.py and debt_fold.py --check are clean.
  • pr_overlap.py --branch could not compare the 24 pull requests that touch these files and conflict with main. I read the relevant ones by hand. #27670 adds its scaled-sampler proof right after the normalized-S# branch of ProveUnnormalized that this PR changes. It and #20519 also raise the cache format from 98 to 99, as this PR does, so whichever lands second takes the next number. #10867 changes the foldOffset condition in SpirvImageEmitter.cpp, which this PR leaves alone, and #6412 changes ApplyStaticInterface's signature, not its offset loop. None of them changes which modes a foldTexelOffsetsOnly image keeps.

An earlier version also marked images that a gather samples with a computed offset. That broke agc_driver_image_gather_one_dimensional and _array on the HD 630, which already handle those offsets, so gathers are left as on main.

Update 2026-12-04 (head 9198e98815): rebased onto main c1601e56d5. #9457 took shader cache format 99 on main for its own layout change, so this PR's bump to 99 had become a no-op; it now raises the format to 100. #21776, #14871, #27670 and #20519 also bump it, so whichever lands later takes the next number. #14871 also touches two of this PR's lines: the constant-swizzle condition in TryRuntimeImageMode and the ImageResource field count. Both sides of each are kept. On this head (SPIRV-Tools on), the 12 focused tests pass 3/3 on the four devices, except agc_driver_image_plane_offset_on_line on the HD 630 (#28744). A validation-layer run logged nothing, and the checkers and debt_fold.py --check are clean. The split suite fails the same tests as at d8cd56a766: GTX 1050 Ti none, HD 630 and llvmpipe only main's.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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 GTX 1050 Ti (580.178.04), Intel HD Graphics 630 (Mesa 25.2.8 ANV), llvmpipe (Mesa 25.2.8, LLVM 20.1.2), lavapipe 26.0.8; Linux Mint 22.3
  • AI-assisted: yes

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of non-constant texel offsets in cube texture sampling on devices without required graphics features. Unsupported offsets are dropped for cube samples, while incompatible non-cube cases continue to report an error.
  • Tests
    • Added coverage for cube, 1D, and 2D-array sampling with texel offsets, including runs with native offset support enabled and disabled.
  • Documentation
    • Documented the updated shader behavior on devices with limited graphics feature support.
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5629940741 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780). Originally posted by [GiannisG1](https://github.com/GiannisG1) on 2026-12-03T15:52:12Z. --- ### What #23498 drops the texel offset of a sample or gather through a cube T#, as RDNA2 does. On a device without `VK_KHR_maintenance8` (for example Mesa 25.2.8's ANV on an Intel HD Graphics 630), its test `agc_driver_image_sample_cube_offset` still fails before it runs: ``` ShaderRecompiler::Recompile: SPIR-V emission failed: hash=… stage=4 opcode=ImageSampleRaw reason=has a texel offset that is not a constant, which image sampling takes only with VK_KHR_maintenance8 and shaderImageGatherExtended ``` Without native non-constant offsets, `ApplyStaticInterface` marks an image sampled with a computed offset `foldTexelOffsetsOnly`, and `RuntimeImageModes` keeps only the modes an unnormalized S# can sample. That removes the cube modes, the only modes where the offset is dropped. The 2D modes left over cannot take the offset either when the S# cannot fold it into the coordinates (here the same S# serves a gather), so emission fails, although the T# is a cube and the offset would be ignored. This PR: - keeps the cube modes of a `foldTexelOffsetsOnly` image; - marks the image `cubeTexelOffsetsOnly` when its S# cannot fold offsets (`FoldsTexelOffsets`, decided in `ShaderInfoCollector` once the sampler uses are collected), and then keeps only the cube modes. Any other T# is refused when its mode is selected (`… takes only cube images, whose texel offsets RDNA2 ignores, without VK_KHR_maintenance8 and shaderImageGatherExtended`), instead of the whole shader failing to recompile. An image without a cube mode keeps the modes it had; - lets a normalized S# with folded offsets pass `DescriptorBindingBuilder` when every image it samples takes a cube mode. Any other normalized S# is refused as before; - stores the new flag in the shader cache (format 99). Nothing changes on a device with `VK_KHR_maintenance8`, where `foldTexelOffsetsOnly` is never set. The Linux CI job's llvmpipe has it, so it never took this path. `agc_driver_image_sample_cube_offset` now also runs with `nonConstantImageOffsets` forced off, so every device, CI's included, covers it. ### Tested Linux Mint 22.3, kernel 7.0.0, `main` `cde48b5800`, SPIRV-Tools on (as the Linux CI job builds). - RED with `main`'s recompiler sources and the new tests: `agc_driver_image_sample_cube_offset` fails on the HD 630 in its native pass and on llvmpipe in the pass without `VK_KHR_maintenance8`, both with the emission message above. `agc_shader_memory` fails on the new cube case with `normalized guest sampler is used with a texel offset that is not a constant`. `agc_shader_disk_cache` does not compile without the new field. - GREEN: `agc_shader_memory`, `agc_shader_disk_cache`, `agc_driver_image_sample_cube_offset`, `agc_driver_image_sample_derivatives`, `agc_driver_image_gather*`, `agc_driver_emulated_color_compare`, `agc_driver_prepared_shaders` and `agc_driver_image_plane_offset_on_line`, 3/3 on the GTX 1050 Ti, the HD 630, llvmpipe (Mesa 25.2.8) and lavapipe 26.0.8. The only failure is `agc_driver_image_plane_offset_on_line` on the HD 630, which also fails on `main` and needs `VK_KHR_maintenance8` for a normalized S# (#28744 skips it there). With the validation layer from Vulkan SDK 1.4.363.1, one more run on each device logged nothing. - Split suite (all tests once, GPU tests on all three GPUs) against our `--full` run of `main` `cde48b5800`: the GTX 1050 Ti fails nothing. On the HD 630, `agc_driver_image_sample_cube_offset` now passes, and every other failure is one `main` has on this machine. On llvmpipe, the failures are `main`'s, except `agc_driver_msaa_resolve_publication_order`, which failed in `main`'s run and passed here. - The source-scanning tests (`conventions`, `public_headers`, `tools_`): 162/162. `check_conventions.py`, `check_test_registration.py`, `check_compile.py` (7 translation units), `check_main_sync.py` and `debt_fold.py --check` are clean. - `pr_overlap.py --branch` could not compare the 24 pull requests that touch these files and conflict with `main`. I read the relevant ones by hand. #27670 adds its scaled-sampler proof right after the normalized-S# branch of `ProveUnnormalized` that this PR changes. It and #20519 also raise the cache format from 98 to 99, as this PR does, so whichever lands second takes the next number. #10867 changes the `foldOffset` condition in `SpirvImageEmitter.cpp`, which this PR leaves alone, and #6412 changes `ApplyStaticInterface`'s signature, not its offset loop. None of them changes which modes a `foldTexelOffsetsOnly` image keeps. An earlier version also marked images that a gather samples with a computed offset. That broke `agc_driver_image_gather_one_dimensional` and `_array` on the HD 630, which already handle those offsets, so gathers are left as on `main`. **Update 2026-12-04 (head `9198e98815`):** rebased onto `main` `c1601e56d5`. #9457 took shader cache format 99 on `main` for its own layout change, so this PR's bump to 99 had become a no-op; it now raises the format to 100. #21776, #14871, #27670 and #20519 also bump it, so whichever lands later takes the next number. #14871 also touches two of this PR's lines: the constant-swizzle condition in `TryRuntimeImageMode` and the `ImageResource` field count. Both sides of each are kept. On this head (SPIRV-Tools on), the 12 focused tests pass 3/3 on the four devices, except `agc_driver_image_plane_offset_on_line` on the HD 630 (#28744). A validation-layer run logged nothing, and the checkers and `debt_fold.py --check` are clean. The split suite fails the same tests as at `d8cd56a766`: GTX 1050 Ti none, HD 630 and llvmpipe only `main`'s. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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 GTX 1050 Ti (580.178.04), Intel HD Graphics 630 (Mesa 25.2.8 ANV), llvmpipe (Mesa 25.2.8, LLVM 20.1.2), lavapipe 26.0.8; Linux Mint 22.3 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Improved handling of non-constant texel offsets in cube texture sampling on devices without required graphics features. Unsupported offsets are dropped for cube samples, while incompatible non-cube cases continue to report an error. * **Tests** * Added coverage for cube, 1D, and 2D-array sampling with texel offsets, including runs with native offset support enabled and disabled. * **Documentation** * Documented the updated shader behavior on devices with limited graphics feature support. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
ligmaSec commented 2026-12-03 15:59:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T15:59:38Z.

Review: COMMENTED


The normalized-sampler check considers every image paired with the sampler. A sampler can be shared by an offset cube instruction and an ordinary 2D sample. The 2D pair makes cubeOnly() false even though that pair does not need computed-offset support. Can the proof distinguish the uses that actually supply an offset?

On Linux/lavapipe, the cube-offset, scalar-buffer, shader-memory, and disk-cache cases passed on main at 9d362fb088fc and with this head integrated. The Vulkan runs required the device, disabled the shader cache, and loaded Khronos validation 1.4.369 without missing-layer warnings or VUIDs. These fixtures passed without exercising the mixed cube and 2D sampler case above.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6173408190 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6173408190). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T15:59:38Z. **Review:** COMMENTED --- The normalized-sampler check considers every image paired with the sampler. A sampler can be shared by an offset cube instruction and an ordinary 2D sample. The 2D pair makes `cubeOnly()` false even though that pair does not need computed-offset support. Can the proof distinguish the uses that actually supply an offset? On Linux/lavapipe, the cube-offset, scalar-buffer, shader-memory, and disk-cache cases passed on main at `9d362fb088fc` and with this head integrated. The Vulkan runs required the device, disabled the shader cache, and loaded Khronos validation 1.4.369 without missing-layer warnings or VUIDs. These fixtures passed without exercising the mixed cube and 2D sampler case above. AI-assisted: yes.
MarcZX10 commented 2026-12-03 15:59:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T15:59:45Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

A runtime image with cubeTexelOffsetsOnly can still match and accept a non-cube mode, bypassing the intended rejection.

What I ran

Reviewed head 178de5eb1c1585f981fa133abcb9b32f9a14f420 using repo_read.py searches and targeted source reads. I ran no builds or tests.

Results

Check Result Note
Changed code review failed One blocking runtime mode check defect
Build and tests not run No execution checks performed

Negative Control

Not run; no test was changed or executed as a negative control.

Findings

Blocking

  • Non-cube runtime modes bypass the cube-only restriction. In RuntimeImageModes, when no cube mode exists but an unnormalized mode does, the fallback retains unnormalized modes (core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:2661). TryRuntimeImageMode then returns as soon as one of those modes matches, before reaching the cubeTexelOffsetsOnly rejection at line 2733. A computed offset for a sampler that cannot fold offsets can therefore be accepted with a non-cube image, despite the intended refusal. Enforce the cube-only restriction before accepting a matched mode, while preserving valid cube matches.

Sources

Not verified

No build, automated tests, GPU execution, or author-reported test results were independently verified. I read all changed files listed in manifest.json and files.json, including ShaderMemory.cpp through the pinned reader; those lists show no excluded files.

To get this to a good state

Reject non-cube runtime descriptors when cubeTexelOffsetsOnly is set, before a non-cube mode can be accepted. Then rerun the cube-offset shader memory and execution coverage, including a non-cube descriptor case.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6173410383 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6173410383). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-03T15:59:45Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested A runtime image with `cubeTexelOffsetsOnly` can still match and accept a non-cube mode, bypassing the intended rejection. ## What I ran Reviewed head `178de5eb1c1585f981fa133abcb9b32f9a14f420` using `repo_read.py` searches and targeted source reads. I ran no builds or tests. ## Results | Check | Result | Note | |---|---|---| | Changed code review | failed | One blocking runtime mode check defect | | Build and tests | not run | No execution checks performed | ## Negative Control Not run; no test was changed or executed as a negative control. ## Findings ### Blocking - **Non-cube runtime modes bypass the cube-only restriction.** In `RuntimeImageModes`, when no cube mode exists but an unnormalized mode does, the fallback retains unnormalized modes (`core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp:2661`). `TryRuntimeImageMode` then returns as soon as one of those modes matches, before reaching the `cubeTexelOffsetsOnly` rejection at line 2733. A computed offset for a sampler that cannot fold offsets can therefore be accepted with a non-cube image, despite the intended refusal. Enforce the cube-only restriction before accepting a matched mode, while preserving valid cube matches. ## Sources - [ResourceMaterializer.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/178de5eb1c1585f981fa133abcb9b32f9a14f420/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp) - [ShaderInfoCollector.cpp at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/178de5eb1c1585f981fa133abcb9b32f9a14f420/core/shader/recompiler/Optimization/src/ShaderInfoCollector.cpp) ## Not verified No build, automated tests, GPU execution, or author-reported test results were independently verified. I read all changed files listed in `manifest.json` and `files.json`, including `ShaderMemory.cpp` through the pinned reader; those lists show no excluded files. ## To get this to a good state Reject non-cube runtime descriptors when `cubeTexelOffsetsOnly` is set, before a non-cube mode can be accepted. Then rerun the cube-offset shader memory and execution coverage, including a non-cube descriptor case.
MarcZX10 commented 2026-12-03 20:03:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T20:03:10Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this; the points below are optional.

What I ran

Reviewed head d8cd56a76631d4fed275deb121577051cd503255 using repo_read.py to inspect the changed hunks and relevant source context. No tests or builds were run. The test results in the PR description are author-reported and were not reproduced.

Results

Check Result Note
Source review passed All 10 changed files reviewed; no excluded files
Tests and builds not run No execution performed
Author-reported checks not run Not independently verified

Negative control

Not run; no tests were run during this review.

Findings

Blocking

None.

Non-blocking

None.

Sources

Not verified

The full contents of large files were not read; review covered all changed hunks and relevant surrounding code. No hardware behavior, CI results, or author-reported test results were independently verified.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177506569 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6177506569). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-03T20:03:10Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this; the points below are optional. ## What I ran Reviewed head `d8cd56a76631d4fed275deb121577051cd503255` using `repo_read.py` to inspect the changed hunks and relevant source context. No tests or builds were run. The test results in the PR description are author-reported and were not reproduced. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | All 10 changed files reviewed; no excluded files | | Tests and builds | not run | No execution performed | | Author-reported checks | not run | Not independently verified | ## Negative control Not run; no tests were run during this review. ## Findings ### Blocking None. ### Non-blocking None. ## Sources - [Resource mode preparation and selection](https://github.com/boykopovar/AnyPS5/blob/d8cd56a76631d4fed275deb121577051cd503255/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp#L2657-L2663) - [Sampler-use analysis and mode refresh](https://github.com/boykopovar/AnyPS5/blob/d8cd56a76631d4fed275deb121577051cd503255/core/shader/recompiler/Optimization/src/ShaderInfoCollector.cpp#L658-L668) - [Normalized sampler validation](https://github.com/boykopovar/AnyPS5/blob/d8cd56a76631d4fed275deb121577051cd503255/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp#L327-L339) - [Shader cache format and flag encoding](https://github.com/boykopovar/AnyPS5/blob/d8cd56a76631d4fed275deb121577051cd503255/core/shader/recompiler/ShaderDiskCache.hpp#L18-L21) and [encoding](https://github.com/boykopovar/AnyPS5/blob/d8cd56a76631d4fed275deb121577051cd503255/core/shader/recompiler/ShaderDiskCache.cpp#L865-L869) ## Not verified The full contents of large files were not read; review covered all changed hunks and relevant surrounding code. No hardware behavior, CI results, or author-reported test results were independently verified. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 20:32:33 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T20:32:33Z.

Review: COMMENTED


The new 1D sample-plus-gather refusal covers a useful boundary. The earlier mixed-resource case is still worth checking in its own fixture. A computed-offset cube sample and an ordinary 2D sample can share the same S#. Their combination tests the sampler proof separately from the new rejection of invalid descriptor modes.

Source review at d8cd56a766. The head trial-merges onto 700fae9438 and its paired checks are queued.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6177984295 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6177984295). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T20:32:33Z. **Review:** COMMENTED --- The new 1D sample-plus-gather refusal covers a useful boundary. The earlier mixed-resource case is still worth checking in its own fixture. A computed-offset cube sample and an ordinary 2D sample can share the same S#. Their combination tests the sampler proof separately from the new rejection of invalid descriptor modes. Source review at `d8cd56a766`. The head trial-merges onto `700fae9438` and its paired checks are queued. AI-assisted: yes.
MarcZX10 commented 2026-12-04 01:55:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T01:55:00Z.

Review: COMMENTED


Reviewed — no blocking findings

The changed code and all listed changed files were inspected, and no blocking defect was verified; runtime checks were not run independently.

What I ran

Reviewed head 9198e98815b857a89eb27f3602f90eb1489895a using the prepared diff, included head files, and the reader output for the added ShaderMemory.cpp lines. No tests or build commands were run.

No tests or build commands run.

Results

Check Result Note
Changed-file review passed All 10 listed files inspected
Runtime and test checks not run Description reports author-run results
Reader context lookup not run Reader output was blocked after the requested lines by its read-only log write

Negative control

Could not run a negative control; no test was run independently.

Findings

Blocking

None verified.

Non-blocking

None.

Sources

The main behavior claims are supported by the changed code at the pinned head: ResourceMaterializer.cpp, ShaderInfoCollector.cpp, and DescriptorBindingBuilder.cpp.

Not verified

No tests, builds, or device behavior were independently verified. The author-reported test and checker results in the PR description were not rerun. Read all files listed under reviewed in files.json: ShaderDiskCache.cpp, ShaderMemory.cpp, ImageSampleCubeOffset.cpp, Resources.hpp, DescriptorBindingBuilder.cpp, ResourceMaterializer.cpp, ShaderInfoCollector.cpp, ShaderDiskCache.cpp, ShaderDiskCache.hpp, and fix-shader-cube-offsets-without-maintenance8.md. ShaderMemory.cpp was read through repo_read.py; the other changed files were read from the prepared folder. files.json lists no excluded changed files. Additional callers and surrounding source context were not verified because the reader could not complete its logging step in the read-only workspace.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6181850291 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6181850291). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-12-04T01:55:00Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The changed code and all listed changed files were inspected, and no blocking defect was verified; runtime checks were not run independently. ## What I ran Reviewed head `9198e98815b857a89eb27f3602f90eb1489895a` using the prepared diff, included head files, and the reader output for the added `ShaderMemory.cpp` lines. No tests or build commands were run. ```text No tests or build commands run. ``` ## Results | Check | Result | Note | |---|---|---| | Changed-file review | passed | All 10 listed files inspected | | Runtime and test checks | not run | Description reports author-run results | | Reader context lookup | not run | Reader output was blocked after the requested lines by its read-only log write | ## Negative control Could not run a negative control; no test was run independently. ## Findings ### Blocking None verified. ### Non-blocking None. ## Sources The main behavior claims are supported by the changed code at the pinned head: [ResourceMaterializer.cpp](https://github.com/boykopovar/AnyPS5/blob/9198e98815b857a89eb27f3602f90eb1489895a9/core/shader/recompiler/Optimization/src/ResourceMaterializer.cpp), [ShaderInfoCollector.cpp](https://github.com/boykopovar/AnyPS5/blob/9198e98815b857a89eb27f3602f90eb1489895a9/core/shader/recompiler/Optimization/src/ShaderInfoCollector.cpp), and [DescriptorBindingBuilder.cpp](https://github.com/boykopovar/AnyPS5/blob/9198e98815b857a89eb27f3602f90eb1489895a9/core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cpp). ## Not verified No tests, builds, or device behavior were independently verified. The author-reported test and checker results in the PR description were not rerun. Read all files listed under `reviewed` in `files.json`: `ShaderDiskCache.cpp`, `ShaderMemory.cpp`, `ImageSampleCubeOffset.cpp`, `Resources.hpp`, `DescriptorBindingBuilder.cpp`, `ResourceMaterializer.cpp`, `ShaderInfoCollector.cpp`, `ShaderDiskCache.cpp`, `ShaderDiskCache.hpp`, and `fix-shader-cube-offsets-without-maintenance8.md`. `ShaderMemory.cpp` was read through repo_read.py; the other changed files were read from the prepared folder. `files.json` lists no excluded changed files. Additional callers and surrounding source context were not verified because the reader could not complete its logging step in the read-only workspace. ## To get this to a good state Nothing is required.
Plyxen commented 2026-12-04 13:37:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T13:37:41Z.

Review: APPROVED


Verified on Windows 11 (GCC 15.2, Release) on main 484b0368d3, with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and the Khronos validation layer 1.4.363. Every run log shows the loader inserting the layer and none shows "was not found". It ran on an RTX 5080 (621.24) and an AMD Radeon iGPU (26.11.2), together with #28820, #28802, #28646 and #28670.

  • agc_driver_image_sample_cube_offset*, agc_shader_memory* and agc_shader_disk_cache* passed on main and with this change on both GPUs, with no VUID- messages.
  • With the recompiler sources reverted to main and the new tests kept, agc_driver_image_sample_cube_offset fails on both GPUs in its pass without VK_KHR_maintenance8, with "SPIR-V emission failed … opcode=ImageSampleRaw reason=has a texel offset that is not a constant". The tests therefore cover the fix.

Not run: Linux.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6189956375 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/28780#pullrequestreview-6189956375). Originally posted by [Plyxen](https://github.com/Plyxen) on 2026-12-04T13:37:41Z. **Review:** APPROVED --- Verified on Windows 11 (GCC 15.2, Release) on main 484b0368d3, with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1` and the Khronos validation layer 1.4.363. Every run log shows the loader inserting the layer and none shows "was not found". It ran on an RTX 5080 (621.24) and an AMD Radeon iGPU (26.11.2), together with #28820, #28802, #28646 and #28670. - `agc_driver_image_sample_cube_offset*`, `agc_shader_memory*` and `agc_shader_disk_cache*` passed on main and with this change on both GPUs, with no `VUID-` messages. - With the recompiler sources reverted to main and the new tests kept, `agc_driver_image_sample_cube_offset` fails on both GPUs in its pass without `VK_KHR_maintenance8`, with "SPIR-V emission failed … opcode=ImageSampleRaw reason=has a texel offset that is not a constant". The tests therefore cover the fix. Not run: Linux. AI-assisted: yes (Claude Code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/28780:upstream-pr/28780'
git switch 'upstream-pr/28780'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/28780'
git switch 'upstream-pr/28780'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/28780'
git switch 'upstream-pr/28780'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/28780'
git switch 'main'
git merge --squash 'upstream-pr/28780'
git switch 'main'
git merge --ff-only 'upstream-pr/28780'
git switch 'main'
git merge 'upstream-pr/28780'
git push origin 'main'
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!28780
No description provided.