feat(shader): gather through a 1D texture from a 2D image interface #18826

Closed
JJenkx wants to merge 1 commit from upstream-pr/18826 into main
JJenkx commented 2026-11-12 11:40:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-11-12T11:40:31Z.


What

Allow a DIM 2D image_gather4_lz to bind a 1D texture descriptor, using the existing 1D gather lowering. ResourceTracker previously removed the 1D compatibility mode for every gather, so the runtime refused this combination with image descriptor is incompatible with the static runtime image interface.

The hardware measurement shows that this access ignores the second coordinate and matches DIM 1D through the same T#. Only the ordinary level-zero gather gains the compatibility flag. DIM 2D_ARRAY gathers, comparison/offset/horizontal/packed variants do not gain it. Existing load and sample compatibility stays in place.

The existing 1D gather fixture now tests the 2D access with varying second coordinates under edge, wrap and border addressing, alongside the native 1D border control. This is generic shader behavior, with no title, address or descriptor-value check.

Tested

Independent additional GPU reports at this head: Doorriiaann reports RTX 3070 runs, with five gather tests passing twice on each side, the new case failing on the matched test-only control, and zero VUID or missing-layer messages under validation layer 1.4.335. tablefrogpillow reports Vega, RDNA2 and RDNA3 results. These are independent contributor reports; the local hardware qualification above remains the RX 6650 XT run.

Base: b3b3ac0379b749f6e49c2b5ee84f25c73d68dcba; head: e6ccd894d85a9ae776f87679475dfb142c2763bc. Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT / RADV Mesa 26.2.6. Both SDKs build. The qualified production and test bytes match this head; only the debt-note insertion point moved afterward. Frozen binaries can retain the base/dirty revision label.

Hardware oracle: canonical tools/hw-oracle/hw_oracle.py, HSA 7.2.4, local RDNA2 gfx1032, wave32. IEEE off, DX10 clamp on, f32 denormals flushed, f16/f64 denormals preserved, both rounding modes nearest-even, fp16 overflow to infinity. All 1,152 rows match DIM 1D and DIM 2D gathers across widths 1 and 8, linear R16_UNORM and RGBA8_UNORM, eight U coordinates, four V coordinates, and independently selected U/V wrap, edge and border modes. Native 1D/2D level-zero samples provide controls. The PS5's gfx1013 was not measured.

Paired Vulkan regression:

Test Main with new regression Change
agc_driver_image_gather_one_dimensional Expected interface refusal at the new 2D access Pass
agc_driver_image_gather_one_dimensional_array Pass Pass
agc_driver_image_plane_address_on_line Pass Pass
agc_driver_image_plane_address_on_line_implicit_lod Pass Pass

Both arms use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer. Both logs confirm insertion of validation layer 1.4.363. No skips, missing-layer message or VUID errors in either arm. The main failure is the new regression's expected refusal, not a passing test.

Title check: In Sound Mind, PPSA04921 (existing report #14030). Pure main aborts at 84.6 s with the recorded descriptor/interface refusal. The first candidate run passes that refusal and closes normally at 183.2 s, but only established the menu and opening transition.

A follow-up using the same qualified SDK and its inactive shader cache reaches the rendered difficulty menu, ocean/outdoor opening sequence, and first-person opening room with the health HUD and movement tutorial by 210 s. A three-second forward-stick command at 270.362 s moves the viewpoint toward the stairs/wall in the reviewed 285-second capture. It exits 0 at the scheduled 300-second close (303.7 s total), with all protected hashes, mounts and kernel settings restored and no leftover native process. A subsequent private-save reload reaches the same opening Trash Room by120s without replaying the intro; a one-second right-stick pulse also rotates the camera in the reviewed186s capture. That run exits0 at209.4s with all cleanup guards passing. Audio, later areas, long sessions and reference visual fidelity remain unverified; this is an opening-room movement check, not complete playability or an FPS gain claim.

Warm progression captures, input receipt and diagnostic trace, SHA-256 9ddcae442041ff6540a0510285738326b96bf769052175bbef9377e2dd828b3d; downloaded archive and all 11 members verified. The opening-sequence trace filled its event buffer (trace_dropped=true), so its slice inventories and GPU union describe retained events only; it is not a matched performance comparison. No source changed for this follow-up. Windows remains untested.

Save reload, camera-look and complete stationary-room diagnostic evidence, SHA-256 52237454f5c0c159c78552ec66d49f2728b972763bacf609e0023b96fd8878df (download and all11 members verified). The five-second default-setting room trace has62presents, frame p50=81.979ms and trace_dropped=false. The paired batch512 environment probe shows no improvement in this short pair; this is not pure-main-versus-PR qualification or a speed claim. Source and SDK stay unchanged.

Evidence archive: complete hardware rows and standalone reproduction script, paired verbose CTest logs/XML, source pins/patch, native results and captures. SHA-256 f2089b23103035473927ffb2a54a7c6926e711bd91ed8b6490768e40b8061829; downloaded archive and all 30 members verified. No game executables, saves or shader request payloads are included.

Conventions and whitespace checks pass. The official overlap scan covered 1,768 open PR heads. #16321 shares an adjacent additive debt-note insertion point; its BY2/BY4 stores are independent of this gather mode. Shared ResourceTracker changes in older conflicting branches were also checked; none adds this compatibility. Retain both debt notes if their merge order creates an additive conflict. No functional dependency is required.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA04921 #14030 — passes the observed shader refusal; reaches the opening room and responds to forward movement, later gameplay unverified
  • GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.14; HSA hardware measurements target gfx1032
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5276709142 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/18826). Originally posted by [JJenkx](https://github.com/JJenkx) on 2026-11-12T11:40:31Z. --- ### What Allow a DIM 2D `image_gather4_lz` to bind a 1D texture descriptor, using the existing 1D gather lowering. `ResourceTracker` previously removed the 1D compatibility mode for every gather, so the runtime refused this combination with `image descriptor is incompatible with the static runtime image interface`. The hardware measurement shows that this access ignores the second coordinate and matches DIM 1D through the same T#. Only the ordinary level-zero gather gains the compatibility flag. DIM 2D_ARRAY gathers, comparison/offset/horizontal/packed variants do not gain it. Existing load and sample compatibility stays in place. The existing 1D gather fixture now tests the 2D access with varying second coordinates under edge, wrap and border addressing, alongside the native 1D border control. This is generic shader behavior, with no title, address or descriptor-value check. ### Tested Independent additional GPU reports at this head: [Doorriiaann reports RTX 3070 runs](https://github.com/boykopovar/AnyPS5/pull/18826#issuecomment-6828055103), with five gather tests passing twice on each side, the new case failing on the matched test-only control, and zero VUID or missing-layer messages under validation layer 1.4.335. [tablefrogpillow reports Vega, RDNA2 and RDNA3 results](https://github.com/boykopovar/AnyPS5/pull/18826#issuecomment-6828421173). These are independent contributor reports; the local hardware qualification above remains the RX 6650 XT run. <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Base: `b3b3ac0379b749f6e49c2b5ee84f25c73d68dcba`; head: `e6ccd894d85a9ae776f87679475dfb142c2763bc`. Linux 7.2.14, Ryzen 9 7950X, RX 6650 XT / RADV Mesa 26.2.6. Both SDKs build. The qualified production and test bytes match this head; only the debt-note insertion point moved afterward. Frozen binaries can retain the base/dirty revision label. **Hardware oracle:** canonical `tools/hw-oracle/hw_oracle.py`, HSA 7.2.4, local RDNA2 **gfx1032**, wave32. IEEE off, DX10 clamp on, f32 denormals flushed, f16/f64 denormals preserved, both rounding modes nearest-even, fp16 overflow to infinity. All **1,152 rows** match DIM 1D and DIM 2D gathers across widths 1 and 8, linear R16_UNORM and RGBA8_UNORM, eight U coordinates, four V coordinates, and independently selected U/V wrap, edge and border modes. Native 1D/2D level-zero samples provide controls. The PS5's gfx1013 was not measured. **Paired Vulkan regression:** | Test | Main with new regression | Change | |---|---|---| | `agc_driver_image_gather_one_dimensional` | Expected interface refusal at the new 2D access | Pass | | `agc_driver_image_gather_one_dimensional_array` | Pass | Pass | | `agc_driver_image_plane_address_on_line` | Pass | Pass | | `agc_driver_image_plane_address_on_line_implicit_lod` | Pass | Pass | Both arms use `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`. Both logs confirm insertion of validation layer **1.4.363**. **No skips, missing-layer message or VUID errors** in either arm. The main failure is the new regression's expected refusal, not a passing test. **Title check:** In Sound Mind, PPSA04921 ([existing report #14030](https://github.com/boykopovar/AnyPS5/discussions/14030)). Pure main aborts at 84.6 s with the recorded descriptor/interface refusal. The first candidate run passes that refusal and closes normally at 183.2 s, but only established the menu and opening transition. A follow-up using the same qualified SDK and its inactive shader cache reaches the rendered difficulty menu, ocean/outdoor opening sequence, and **first-person opening room with the health HUD and movement tutorial by 210 s**. A three-second forward-stick command at 270.362 s moves the viewpoint toward the stairs/wall in the reviewed 285-second capture. It exits 0 at the scheduled 300-second close (303.7 s total), with all protected hashes, mounts and kernel settings restored and no leftover native process. A subsequent private-save reload reaches the same opening Trash Room by120s without replaying the intro; a one-second right-stick pulse also rotates the camera in the reviewed186s capture. That run exits0 at209.4s with all cleanup guards passing. Audio, later areas, long sessions and reference visual fidelity remain unverified; this is an opening-room movement check, not complete playability or an FPS gain claim. [Warm progression captures, input receipt and diagnostic trace](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/insound18826-warm-progression-linux-20261112.tar.gz), SHA-256 `9ddcae442041ff6540a0510285738326b96bf769052175bbef9377e2dd828b3d`; downloaded archive and all 11 members verified. The opening-sequence trace filled its event buffer (`trace_dropped=true`), so its slice inventories and GPU union describe retained events only; it is not a matched performance comparison. No source changed for this follow-up. Windows remains untested. [Save reload, camera-look and complete stationary-room diagnostic evidence](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/insound-room-reload-batch-diagnostic-linux-20261112.tar.gz), SHA-256 `52237454f5c0c159c78552ec66d49f2728b972763bacf609e0023b96fd8878df` (download and all11 members verified). The five-second default-setting room trace has62presents, frame p50=81.979ms and `trace_dropped=false`. The paired batch512 environment probe shows no improvement in this short pair; this is not pure-main-versus-PR qualification or a speed claim. Source and SDK stay unchanged. [Evidence archive](https://github.com/JJenkx/AnyPS5/releases/download/linux-validation-20261023/insound-2d-gather-line-linux-20261112.tar.gz): complete hardware rows and standalone reproduction script, paired verbose CTest logs/XML, source pins/patch, native results and captures. SHA-256 `f2089b23103035473927ffb2a54a7c6926e711bd91ed8b6490768e40b8061829`; downloaded archive and all 30 members verified. No game executables, saves or shader request payloads are included. Conventions and whitespace checks pass. The official overlap scan covered 1,768 open PR heads. #16321 shares an adjacent additive debt-note insertion point; its BY2/BY4 stores are independent of this gather mode. Shared `ResourceTracker` changes in older conflicting branches were also checked; none adds this compatibility. Retain both debt notes if their merge order creates an additive conflict. No functional dependency is required. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA04921 #14030 — passes the observed shader refusal; reaches the opening room and responds to forward movement, later gameplay unverified - [x] GPUs tested: AMD Radeon RX 6650 XT, RADV Mesa 26.2.6, Linux 7.2.14; HSA hardware measurements target gfx1032 - [x] AI-assisted: yes

Pull request closed

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!18826
No description provided.