fix(shader): sample single-level volumes through biased 2D accesses #5461

Merged
eljackjoestar-cmd merged 3 commits from upstream-pr/5461 into main 2026-10-14 20:49:09 +00:00
eljackjoestar-cmd commented 2026-10-13 20:15:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-13T20:15:44Z.


What

Lost Soul Aside (PPSA26358) stops during scene loading when a plain pixel image_sample_b with DIM 2D is bound to a one-slice, mip-zero-only 3D T#. No prepared image mode matches that pair.

Allow this restricted pairing for direct, non-depth, unpacked 32-bit bias-only pixel accesses. Descriptor validation requires depth one and base/last/max mip zero; binding validation requires normalized point min/mag filtering and no linear mip filter. The existing coordinate emitter supplies zero for the absent third coordinate. Other accesses and larger mip/depth ranges remain refused. The proof flag is serialized with a cache format bump.

Semantics measurement

Measured directly on the PC's AMD integrated gfx1036 (Ryzen 7 7800X3D, AMD driver 32.0.21036.18, Windows 11), using a native kernel loaded through OpenCL. The compiler's image_sample_lz DIM 3D instruction was changed to image_sample_b DIM 2D (f0940f08 00400000); coordinate preprocessing was replaced with NOPs, so the three payload VGPRs contain bias, u and v. Texture and buffer descriptors are supplied by OpenCL. No emulator shader code runs in this measurement.

Controls: wave32, IEEE off, DX10 clamp on, f32/f16 denormals preserved, round to nearest even, FP16 overflow off. Textures: 16×16×1, one level, R32_UINT and RGBA8_UNORM. Biases -16, -0.5, 0, 0.5 and 16 all sample the (u,v) texel in slice zero. R32_UINT was checked with point weighted-average/min/max reduction, both FORCE_DEGAMMA states, and the game's exact sampler words (20175700 03800000 00000000 a0500f2e, including Z border addressing). The unchanged LZ/DIM3D instruction gives different results on the same payload, confirming the modified instruction was used. The PS5's gfx1013 and wave64 are not measured; this is recorded in shader debt.

For the UINT texture, texel (x,y) contains 0x01000000 + 256*y + x. At UV pairs (1/32,1/32), (17/32,25/32), (31/32,31/32), (-1/32,33/32), every tested bias returns respectively 01000000, 01000c08, 01000f0f, 0100000f, with the other components 0,0,1. RGBA8 control texels contain bytes 64,128,32,255; FORCE_DEGAMMA changes RGB as expected, while UINT results remain identical.

Tested

Rebased onto main 84b01f9cd042e1d2e9e112f8783aa5a9d26399ee on 2026-10-14; PR head c1218ef4358b13ff9afb3902f611bc1b0fd00808. Standalone branch verification (this PR alone), Windows 11 Pro 10.0.26300, WinLibs GCC 15.2, Release, SPIRV-Tools OFF: runtime and selected native test targets built successfully. All 6 focused tests passed without skips in 2.46 s. Conventions and whitespace checks passed. The conflict resolution retains main's 2D-array loads and stores over 3D descriptors and adds the restricted single-level bias case alongside them. The cache format is 32 and the ImageResource codec has 38 fields. The Vulkan checks above used NVIDIA RTX 5070 / driver 617.14. Three image regressions also passed on AMD integrated gfx1036 / 32.0.21036.18 in 0.69 s, including the existing array-to-volume store regression. No new title/gameplay run, Linux, full-suite or CI result is claimed.

Earlier validation, on the bases stated below:

  • Full Windows Release build on current main a0f5916a2 plus this PR alone; WinLibs GCC 15.2.
  • Five focused tests passed in 1.76 s: shader memory, disk-cache round trip, new single-level volume bias readback, existing 2D-on-1D implicit LOD, and 3D-on-2D addressing.
  • New readback passes on NVIDIA RTX 5070 (617.14) and AMD integrated gfx1036 (32.0.21036.18). It checks biases -16/-0.5/0/0.5/16 and point min/max reductions; it rejects extra slices, extra mip levels, linear filtering and unnormalized coordinates.
  • Negative control with the new 3D mode removed fails at the original descriptor mismatch. Restoring it passes.
  • Integrated Lost Soul Aside build: captured 136-word request recompiles to 3,826 SPIR-V words; a fresh launch passes the title after two X presses and advances past this rejection to the separate unsupported FORCE_DEGAMMA/RGBA8_UINT binding. Gameplay is not yet reached. That runtime build also contains #4551, #4806, #5049, #5198, the #4715 point-size integration, #5003 depth-storage integration and the occlusion-query workaround; they are not in this PR.
  • Convention checks and diff whitespace checks pass. Pairwise git merge-tree with #5375 is clean; its 3D-on-1D access support is independent. No combined runtime validation is claimed.

Raw measurement

Input rows, controls and all native outputs
{
  "device": "gfx1036",
  "driver": "32.0.21036.18",
  "rows": [
    [
      -16.0,
      0.03125,
      0.03125,
      0.0
    ],
    [
      -16.0,
      0.53125,
      0.78125,
      0.0
    ],
    [
      -16.0,
      0.96875,
      0.96875,
      0.0
    ],
    [
      -16.0,
      -0.03125,
      1.03125,
      0.0
    ],
    [
      -0.5,
      0.03125,
      0.03125,
      0.0
    ],
    [
      -0.5,
      0.53125,
      0.78125,
      0.0
    ],
    [
      -0.5,
      0.96875,
      0.96875,
      0.0
    ],
    [
      -0.5,
      -0.03125,
      1.03125,
      0.0
    ],
    [
      0.0,
      0.03125,
      0.03125,
      0.0
    ],
    [
      0.0,
      0.53125,
      0.78125,
      0.0
    ],
    [
      0.0,
      0.96875,
      0.96875,
      0.0
    ],
    [
      0.0,
      -0.03125,
      1.03125,
      0.0
    ],
    [
      0.5,
      0.03125,
      0.03125,
      0.0
    ],
    [
      0.5,
      0.53125,
      0.78125,
      0.0
    ],
    [
      0.5,
      0.96875,
      0.96875,
      0.0
    ],
    [
      0.5,
      -0.03125,
      1.03125,
      0.0
    ],
    [
      16.0,
      0.03125,
      0.03125,
      0.0
    ],
    [
      16.0,
      0.53125,
      0.78125,
      0.0
    ],
    [
      16.0,
      0.96875,
      0.96875,
      0.0
    ],
    [
      16.0,
      -0.03125,
      1.03125,
      0.0
    ]
  ],
  "controls": {
    "wave32": true,
    "ieee": 0,
    "dx10_clamp": 1,
    "denorm32": 3,
    "denorm16": 3,
    "round32": 0,
    "round16": 0,
    "fp16_overflow": 0
  },
  "cases": [
    {
      "format": "R32_UINT",
      "reduction": 0,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 0,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 1,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 1,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 2,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 2,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "RGBA8_UNORM",
      "reduction": 0,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ],
        [
          1048608897,
          1056997505,
          1040220289,
          1065353216
        ]
      ]
    },
    {
      "format": "RGBA8_UNORM",
      "reduction": 0,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 1,
      "force_degamma": 1,
      "exact_game_sampler": true,
      "baseline_lz_dim3d": false,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16780296,
          0,
          0,
          1
        ],
        [
          16781071,
          0,
          0,
          1
        ],
        [
          16777231,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 0,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 0,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 1,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 1,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 2,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ],
        [
          64,
          128,
          32,
          255
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 2,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ]
      ]
    },
    {
      "format": "RGBA8_UINT",
      "reduction": 1,
      "force_degamma": 1,
      "exact_game_sampler": true,
      "baseline_lz_dim3d": false,
      "output": [
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ],
        [
          1028784128,
          1046282240,
          1013776384,
          1065353216
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 0,
      "force_degamma": 0,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": true,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16777224,
          0,
          0,
          1
        ],
        [
          16779272,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16777224,
          0,
          0,
          1
        ],
        [
          16779272,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ]
      ]
    },
    {
      "format": "R32_UINT",
      "reduction": 0,
      "force_degamma": 1,
      "exact_game_sampler": false,
      "baseline_lz_dim3d": true,
      "output": [
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16777224,
          0,
          0,
          1
        ],
        [
          16779272,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16777224,
          0,
          0,
          1
        ],
        [
          16779272,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16781064,
          0,
          0,
          1
        ],
        [
          16777216,
          0,
          0,
          1
        ],
        [
          16779264,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ],
        [
          16781056,
          0,
          0,
          1
        ]
      ]
    }
  ]
}

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; unsupported dimensions, access forms and samplers remain refused
  • No notes, investigation files or images added to the repository
  • New third-party code is a submodule built from source: n/a
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA26358 #4401 (one loading rejection; gameplay still blocked)
  • GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11; AMD integrated gfx1036, driver 32.0.21036.18, Windows 11
  • AI-assisted: yes (Codex)
Reproduction script (Windows OpenCL, gfx1036)

The script checks the compiled instruction/register encoding before modifying the native kernel, and fails if the compiler layout differs. Requires Python 3 and the AMD OpenCL driver; no emulator build is used.

import ctypes as c
import json
import struct
from pathlib import Path

cl = c.WinDLL('OpenCL.dll')
P = c.c_void_p
U = c.c_uint
I = c.c_int
Z = c.c_size_t
Q = c.c_ulonglong

def bind(name, ret, args):
    f = getattr(cl, name)
    f.restype = ret
    f.argtypes = args
    return f

platforms = bind('clGetPlatformIDs', I, [U, P, P])
devices = bind('clGetDeviceIDs', I, [P, Q, U, P, P])
device_info = bind('clGetDeviceInfo', I, [P, U, Z, P, P])
create_context = bind('clCreateContext', P, [P, U, P, P, P, P])
create_source = bind('clCreateProgramWithSource', P, [P, U, P, P, P])
build = bind('clBuildProgram', I, [P, U, P, c.c_char_p, P, P])
program_info = bind('clGetProgramInfo', I, [P, U, Z, P, P])
build_info = bind('clGetProgramBuildInfo', I, [P, P, U, Z, P, P])
release_program = bind('clReleaseProgram', I, [P])
release_context = bind('clReleaseContext', I, [P])

def check(result, label):
    if result != 0:
        raise RuntimeError(f'{label}: OpenCL error {result}')

count = U()
check(platforms(0, None, c.byref(count)), 'platform count')
platform_ids = (P * count.value)()
check(platforms(count, platform_ids, None), 'platforms')
device = None
for platform in platform_ids:
    n = U()
    check(devices(platform, 0xffffffff, 0, None, c.byref(n)), 'device count')
    ids = (P * n.value)()
    check(devices(platform, 0xffffffff, n, ids, None), 'devices')
    for candidate in ids:
        name = c.create_string_buffer(1024)
        check(device_info(candidate, 0x102b, len(name), name, None), 'device name')
        if name.value == b'gfx1036':
            device = P(candidate)
if not device:
    raise RuntimeError('gfx1036 is not available')
err = I()
context = create_context(None, 1, c.byref(device), None, None, c.byref(err))
check(err.value, 'context')
source = b'''
__kernel void probe(read_only image3d_t image, __global const float4* input, __global uint4* output) {
    const uint id = get_global_id(0);
    const float4 coord = input[id];
    output[id] = read_imageui(image, CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_NEAREST, coord);
}
'''
source_ptr = c.c_char_p(source)
source_len = Z(len(source))
program = create_source(context, 1, c.byref(source_ptr), c.byref(source_len), c.byref(err))
check(err.value, 'program')
result = build(program, 1, c.byref(device), b'-cl-std=CL2.0', None, None)
log_size = Z()
check(build_info(program, device, 0x1183, 0, None, c.byref(log_size)), 'build log size')
log = c.create_string_buffer(log_size.value)
check(build_info(program, device, 0x1183, len(log), log, None), 'build log')
print(log.value.decode())
check(result, 'build')
binary_size = Z()
check(program_info(program, 0x1165, c.sizeof(binary_size), c.byref(binary_size), None), 'binary size')
binary = c.create_string_buffer(binary_size.value)
binary_ptr = c.cast(binary, P)
check(program_info(program, 0x1166, c.sizeof(binary_ptr), c.byref(binary_ptr), None), 'binary')
path = Path(__file__).with_name('amd-opencl-texture-original.bin')
path.write_bytes(binary.raw)
print('binary', binary_size.value, binary.raw[:16].hex())
check(release_program(program), 'release program')
check(release_context(context), 'release context')

create_binary = bind('clCreateProgramWithBinary', P, [P, U, P, P, P, P, P])
create_queue = bind('clCreateCommandQueue', P, [P, P, Q, P])
create_buffer = bind('clCreateBuffer', P, [P, Q, Z, P, P])
create_image = bind('clCreateImage', P, [P, Q, P, P, P, P])
create_kernel = bind('clCreateKernel', P, [P, c.c_char_p, P])
set_arg = bind('clSetKernelArg', I, [P, U, Z, P])
enqueue = bind('clEnqueueNDRangeKernel', I, [P, P, U, P, P, P, U, P, P])
read_buffer = bind('clEnqueueReadBuffer', I, [P, P, U, Z, Z, P, U, P, P])
finish = bind('clFinish', I, [P])
release_mem = bind('clReleaseMemObject', I, [P])
release_kernel = bind('clReleaseKernel', I, [P])
release_queue = bind('clReleaseCommandQueue', I, [P])

class ImageFormat(c.Structure):
    _fields_ = [('order', U), ('type', U)]

class ImageDescriptor(c.Structure):
    _fields_ = [('type', U), ('width', Z), ('height', Z), ('depth', Z), ('arraySize', Z), ('rowPitch', Z), ('slicePitch', Z), ('mips', U), ('samples', U), ('buffer', P)]

native = bytearray(path.read_bytes())
sections_offset = struct.unpack_from('<Q', native, 40)[0]
section_size, section_count, names_index = struct.unpack_from('<HHH', native, 58)
headers = [struct.unpack_from('<IIQQQQIIQQ', native, sections_offset + i * section_size) for i in range(section_count)]
names_header = headers[names_index]
names = native[names_header[4]:names_header[4] + names_header[5]]
sections = {names[s[0]:].split(b'\0', 1)[0].decode(): s for s in headers}
text_start, text_size = sections['.text'][4:6]
matches = [o for o in range(text_start, text_start + text_size, 4) if struct.unpack_from('<I', native, o)[0] == 0xf09c0f10]
if len(matches) != 1:
    raise RuntimeError(f'expected one 3D image_sample_lz, found {matches}')
sample_offset = matches[0]
if struct.unpack_from('<I', native, sample_offset + 4)[0] != 0x00400000:
    raise RuntimeError('unexpected image/sampler/address register encoding')
expected_init = {0x9ac: 0xbe8a0b84, 0x9b0: 0xbe8903ff, 0x9b4: 0x00fff000, 0x9c4: 0xbe8803ff, 0x9c8: 0x10003000}
if sample_offset != 0x9f0:
    raise RuntimeError('compiler layout changed')
for offset, value in expected_init.items():
    if struct.unpack_from('<I', native, offset)[0] != value:
        raise RuntimeError(f'compiler sampler initialization changed at {offset:x}')
for offset in range(0x9a0, sample_offset, 4):
    if offset not in expected_init:
        struct.pack_into('<I', native, offset, 0xbf800000)
struct.pack_into('<I', native, sample_offset, 0xf0940f08)
descriptor_offset = sections['.rodata'][4]
rsrc1 = struct.unpack_from('<I', native, descriptor_offset + 48)[0]
mask = (0xff << 12) | (1 << 21) | (1 << 23) | (1 << 26)
rsrc1 = (rsrc1 & ~mask) | (0xf0 << 12) | (1 << 21)
struct.pack_into('<I', native, descriptor_offset + 48, rsrc1)
properties = struct.unpack_from('<H', native, descriptor_offset + 56)[0]
print('native controls', hex(rsrc1), hex(properties), 'wave32', bool(properties & (1 << 10)))

size = 16
texels = (U * (size * size))(*(0x1000000 + y * 256 + x for y in range(size) for x in range(size)))
rows = [(bias, u, v, 0.0) for bias in (-16.0, -0.5, 0.0, 0.5, 16.0) for u, v in ((0.03125, 0.03125), (0.53125, 0.78125), (0.96875, 0.96875), (-0.03125, 1.03125))]
inputs = (c.c_float * (len(rows) * 4))(*(v for row in rows for v in row))
report = {'device': 'gfx1036', 'driver': '32.0.21036.18', 'rows': rows, 'controls': {'wave32': bool(properties & (1 << 10)), 'ieee': 0, 'dx10_clamp': 1, 'denorm32': 3, 'denorm16': 3, 'round32': 0, 'round16': 0, 'fp16_overflow': 0}, 'cases': []}
cases = [(r, d, "R32_UINT", False) for r in (0, 1, 2) for d in (0, 1)] + [(0, d, "RGBA8_UNORM", False) for d in (0, 1)] + [(1, 1, "R32_UINT", True)]
cases += [(r, d, "RGBA8_UINT", False) for r in (0, 1, 2) for d in (0, 1)]
cases.append((1, 1, "RGBA8_UINT", True))
cases.append((0, 0, "R32_UINT", False))
cases.append((0, 1, "R32_UINT", False))
for case_index, (reduction, degamma, format_name, exact_sampler) in enumerate(cases):
    data = bytearray(native)
    baseline = case_index >= len(cases) - 2
    if baseline:
        struct.pack_into("<I", data, sample_offset, 0xf09c0f10)
    struct.pack_into('<I', data, 0x9c8, 0x10003000 | (reduction << 29) | (degamma << 20))
    if exact_sampler:
        struct.pack_into('<I', data, 0x9c8, 0x20175700)
        struct.pack_into('<I', data, 0x9b4, 0x03800000)
        struct.pack_into('<I', data, 0x9ac, 0xbe8a0b80)
        struct.pack_into('<II', data, 0x9e4, 0xbe8b03ff, 0xa0500f2e)
    case_path = path.with_name(f'amd-opencl-bias-dim2d-{format_name}-r{reduction}-d{degamma}-exact{int(exact_sampler)}-baseline{int(baseline)}.bin')
    case_path.write_bytes(data)
    context = create_context(None, 1, c.byref(device), None, None, c.byref(err))
    check(err.value, 'context')
    data_buffer = c.create_string_buffer(bytes(data))
    data_pointer = c.cast(data_buffer, P)
    data_size = Z(len(data))
    binary_status = I()
    program = create_binary(context, 1, c.byref(device), c.byref(data_size), c.byref(data_pointer), c.byref(binary_status), c.byref(err))
    check(err.value, 'load native binary')
    check(binary_status.value, 'native binary status')
    check(build(program, 1, c.byref(device), None, None, None), 'build native binary')
    queue = create_queue(context, device, 0, c.byref(err))
    check(err.value, 'queue')
    image_format = ImageFormat(0x10b0, 0x10dc) if format_name == "R32_UINT" else ImageFormat(0x10b5, 0x10da if format_name == "RGBA8_UINT" else 0x10d2)
    case_texels = texels if format_name == "R32_UINT" else (U * (size * size))(*(0xff208040 for _ in range(size * size)))
    image_descriptor = ImageDescriptor(0x10f2, size, size, 1, 0, 0, 0, 0, 0, None)
    image = P(create_image(context, 4 | 32, c.byref(image_format), c.byref(image_descriptor), case_texels, c.byref(err)))
    check(err.value, 'image')
    input_buffer = P(create_buffer(context, 4 | 32, c.sizeof(inputs), inputs, c.byref(err)))
    check(err.value, 'input')
    output = (U * (len(rows) * 4))()
    output_buffer = P(create_buffer(context, 1, c.sizeof(output), None, c.byref(err)))
    check(err.value, 'output')
    kernel = create_kernel(program, b'probe', c.byref(err))
    check(err.value, 'kernel')
    for index, value in enumerate((image, input_buffer, output_buffer)):
        check(set_arg(kernel, index, c.sizeof(value), c.byref(value)), 'argument')
    global_size = Z(len(rows))
    check(enqueue(queue, kernel, 1, None, c.byref(global_size), None, 0, None, None), 'enqueue')
    check(read_buffer(queue, output_buffer, 1, 0, c.sizeof(output), output, 0, None, None), 'read output')
    check(finish(queue), 'finish')
    results = [list(output[i:i + 4]) for i in range(0, len(output), 4)]
    print('measurement', format_name, reduction, degamma, 'exact', exact_sampler, 'baseline', baseline, results)
    report['cases'].append({'format': format_name, 'reduction': reduction, 'force_degamma': degamma, 'exact_game_sampler': exact_sampler, 'baseline_lz_dim3d': baseline, 'output': results})
    for memory in (image, input_buffer, output_buffer):
        check(release_mem(memory), 'release memory')
    check(release_kernel(kernel), 'release kernel')
    check(release_queue(queue), 'release queue')
    check(release_program(program), 'release program')
    check(release_context(context), 'release context')
path.with_name('amd-opencl-texture-measurement.json').write_text(json.dumps(report, indent=2), encoding='utf-8')

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4848921453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5461). Originally posted by [eljackjoestar-cmd](https://github.com/eljackjoestar-cmd) on 2026-10-13T20:15:44Z. --- ### What Lost Soul Aside (PPSA26358) stops during scene loading when a plain pixel `image_sample_b` with DIM 2D is bound to a one-slice, mip-zero-only 3D T#. No prepared image mode matches that pair. Allow this restricted pairing for direct, non-depth, unpacked 32-bit bias-only pixel accesses. Descriptor validation requires depth one and base/last/max mip zero; binding validation requires normalized point min/mag filtering and no linear mip filter. The existing coordinate emitter supplies zero for the absent third coordinate. Other accesses and larger mip/depth ranges remain refused. The proof flag is serialized with a cache format bump. ### Semantics measurement Measured directly on the PC's AMD integrated gfx1036 (Ryzen 7 7800X3D, AMD driver 32.0.21036.18, Windows 11), using a native kernel loaded through OpenCL. The compiler's `image_sample_lz` DIM 3D instruction was changed to `image_sample_b` DIM 2D (`f0940f08 00400000`); coordinate preprocessing was replaced with NOPs, so the three payload VGPRs contain bias, u and v. Texture and buffer descriptors are supplied by OpenCL. No emulator shader code runs in this measurement. Controls: wave32, IEEE off, DX10 clamp on, f32/f16 denormals preserved, round to nearest even, FP16 overflow off. Textures: 16×16×1, one level, R32_UINT and RGBA8_UNORM. Biases -16, -0.5, 0, 0.5 and 16 all sample the (u,v) texel in slice zero. R32_UINT was checked with point weighted-average/min/max reduction, both FORCE_DEGAMMA states, and the game's exact sampler words (`20175700 03800000 00000000 a0500f2e`, including Z border addressing). The unchanged LZ/DIM3D instruction gives different results on the same payload, confirming the modified instruction was used. The PS5's gfx1013 and wave64 are not measured; this is recorded in shader debt. For the UINT texture, texel (x,y) contains `0x01000000 + 256*y + x`. At UV pairs (1/32,1/32), (17/32,25/32), (31/32,31/32), (-1/32,33/32), every tested bias returns respectively `01000000`, `01000c08`, `01000f0f`, `0100000f`, with the other components 0,0,1. RGBA8 control texels contain bytes 64,128,32,255; FORCE_DEGAMMA changes RGB as expected, while UINT results remain identical. ### Tested Rebased onto main `84b01f9cd042e1d2e9e112f8783aa5a9d26399ee` on 2026-10-14; PR head `c1218ef4358b13ff9afb3902f611bc1b0fd00808`. Standalone branch verification (this PR alone), Windows 11 Pro 10.0.26300, WinLibs GCC 15.2, Release, SPIRV-Tools OFF: runtime and selected native test targets built successfully. All 6 focused tests passed without skips in 2.46 s. Conventions and whitespace checks passed. The conflict resolution retains main's 2D-array loads and stores over 3D descriptors and adds the restricted single-level bias case alongside them. The cache format is 32 and the ImageResource codec has 38 fields. The Vulkan checks above used NVIDIA RTX 5070 / driver 617.14. Three image regressions also passed on AMD integrated gfx1036 / 32.0.21036.18 in 0.69 s, including the existing array-to-volume store regression. No new title/gameplay run, Linux, full-suite or CI result is claimed. Earlier validation, on the bases stated below: - Full Windows Release build on current main `a0f5916a2` plus this PR alone; WinLibs GCC 15.2. - Five focused tests passed in 1.76 s: shader memory, disk-cache round trip, new single-level volume bias readback, existing 2D-on-1D implicit LOD, and 3D-on-2D addressing. - New readback passes on NVIDIA RTX 5070 (617.14) and AMD integrated gfx1036 (32.0.21036.18). It checks biases -16/-0.5/0/0.5/16 and point min/max reductions; it rejects extra slices, extra mip levels, linear filtering and unnormalized coordinates. - Negative control with the new 3D mode removed fails at the original descriptor mismatch. Restoring it passes. - Integrated Lost Soul Aside build: captured 136-word request recompiles to 3,826 SPIR-V words; a fresh launch passes the title after two X presses and advances past this rejection to the separate unsupported FORCE_DEGAMMA/RGBA8_UINT binding. Gameplay is not yet reached. That runtime build also contains #4551, #4806, #5049, #5198, the #4715 point-size integration, #5003 depth-storage integration and the occlusion-query workaround; they are not in this PR. - Convention checks and diff whitespace checks pass. Pairwise `git merge-tree` with #5375 is clean; its 3D-on-1D access support is independent. No combined runtime validation is claimed. ### Raw measurement <details><summary>Input rows, controls and all native outputs</summary> ```json { "device": "gfx1036", "driver": "32.0.21036.18", "rows": [ [ -16.0, 0.03125, 0.03125, 0.0 ], [ -16.0, 0.53125, 0.78125, 0.0 ], [ -16.0, 0.96875, 0.96875, 0.0 ], [ -16.0, -0.03125, 1.03125, 0.0 ], [ -0.5, 0.03125, 0.03125, 0.0 ], [ -0.5, 0.53125, 0.78125, 0.0 ], [ -0.5, 0.96875, 0.96875, 0.0 ], [ -0.5, -0.03125, 1.03125, 0.0 ], [ 0.0, 0.03125, 0.03125, 0.0 ], [ 0.0, 0.53125, 0.78125, 0.0 ], [ 0.0, 0.96875, 0.96875, 0.0 ], [ 0.0, -0.03125, 1.03125, 0.0 ], [ 0.5, 0.03125, 0.03125, 0.0 ], [ 0.5, 0.53125, 0.78125, 0.0 ], [ 0.5, 0.96875, 0.96875, 0.0 ], [ 0.5, -0.03125, 1.03125, 0.0 ], [ 16.0, 0.03125, 0.03125, 0.0 ], [ 16.0, 0.53125, 0.78125, 0.0 ], [ 16.0, 0.96875, 0.96875, 0.0 ], [ 16.0, -0.03125, 1.03125, 0.0 ] ], "controls": { "wave32": true, "ieee": 0, "dx10_clamp": 1, "denorm32": 3, "denorm16": 3, "round32": 0, "round16": 0, "fp16_overflow": 0 }, "cases": [ { "format": "R32_UINT", "reduction": 0, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 0, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 1, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 1, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 2, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 2, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "RGBA8_UNORM", "reduction": 0, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ], [ 1048608897, 1056997505, 1040220289, 1065353216 ] ] }, { "format": "RGBA8_UNORM", "reduction": 0, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ] ] }, { "format": "R32_UINT", "reduction": 1, "force_degamma": 1, "exact_game_sampler": true, "baseline_lz_dim3d": false, "output": [ [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16780296, 0, 0, 1 ], [ 16781071, 0, 0, 1 ], [ 16777231, 0, 0, 1 ] ] }, { "format": "RGBA8_UINT", "reduction": 0, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ] ] }, { "format": "RGBA8_UINT", "reduction": 0, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ] ] }, { "format": "RGBA8_UINT", "reduction": 1, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ] ] }, { "format": "RGBA8_UINT", "reduction": 1, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ] ] }, { "format": "RGBA8_UINT", "reduction": 2, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ], [ 64, 128, 32, 255 ] ] }, { "format": "RGBA8_UINT", "reduction": 2, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": false, "output": [ [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ] ] }, { "format": "RGBA8_UINT", "reduction": 1, "force_degamma": 1, "exact_game_sampler": true, "baseline_lz_dim3d": false, "output": [ [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ], [ 1028784128, 1046282240, 1013776384, 1065353216 ] ] }, { "format": "R32_UINT", "reduction": 0, "force_degamma": 0, "exact_game_sampler": false, "baseline_lz_dim3d": true, "output": [ [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16777224, 0, 0, 1 ], [ 16779272, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16777224, 0, 0, 1 ], [ 16779272, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ] ] }, { "format": "R32_UINT", "reduction": 0, "force_degamma": 1, "exact_game_sampler": false, "baseline_lz_dim3d": true, "output": [ [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16777224, 0, 0, 1 ], [ 16779272, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16777224, 0, 0, 1 ], [ 16779272, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16781064, 0, 0, 1 ], [ 16777216, 0, 0, 1 ], [ 16779264, 0, 0, 1 ], [ 16781056, 0, 0, 1 ], [ 16781056, 0, 0, 1 ] ] } ] } ``` </details> ### 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; unsupported dimensions, access forms and samplers remain refused - [x] No notes, investigation files or images added to the repository - [x] New third-party code is a submodule built from source: n/a - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA26358 #4401 (one loading rejection; gameplay still blocked) - [x] GPUs tested: NVIDIA GeForce RTX 5070, driver 617.14, Windows 11; AMD integrated gfx1036, driver 32.0.21036.18, Windows 11 - [x] AI-assisted: yes (Codex) <details><summary>Reproduction script (Windows OpenCL, gfx1036)</summary> The script checks the compiled instruction/register encoding before modifying the native kernel, and fails if the compiler layout differs. Requires Python 3 and the AMD OpenCL driver; no emulator build is used. ```python import ctypes as c import json import struct from pathlib import Path cl = c.WinDLL('OpenCL.dll') P = c.c_void_p U = c.c_uint I = c.c_int Z = c.c_size_t Q = c.c_ulonglong def bind(name, ret, args): f = getattr(cl, name) f.restype = ret f.argtypes = args return f platforms = bind('clGetPlatformIDs', I, [U, P, P]) devices = bind('clGetDeviceIDs', I, [P, Q, U, P, P]) device_info = bind('clGetDeviceInfo', I, [P, U, Z, P, P]) create_context = bind('clCreateContext', P, [P, U, P, P, P, P]) create_source = bind('clCreateProgramWithSource', P, [P, U, P, P, P]) build = bind('clBuildProgram', I, [P, U, P, c.c_char_p, P, P]) program_info = bind('clGetProgramInfo', I, [P, U, Z, P, P]) build_info = bind('clGetProgramBuildInfo', I, [P, P, U, Z, P, P]) release_program = bind('clReleaseProgram', I, [P]) release_context = bind('clReleaseContext', I, [P]) def check(result, label): if result != 0: raise RuntimeError(f'{label}: OpenCL error {result}') count = U() check(platforms(0, None, c.byref(count)), 'platform count') platform_ids = (P * count.value)() check(platforms(count, platform_ids, None), 'platforms') device = None for platform in platform_ids: n = U() check(devices(platform, 0xffffffff, 0, None, c.byref(n)), 'device count') ids = (P * n.value)() check(devices(platform, 0xffffffff, n, ids, None), 'devices') for candidate in ids: name = c.create_string_buffer(1024) check(device_info(candidate, 0x102b, len(name), name, None), 'device name') if name.value == b'gfx1036': device = P(candidate) if not device: raise RuntimeError('gfx1036 is not available') err = I() context = create_context(None, 1, c.byref(device), None, None, c.byref(err)) check(err.value, 'context') source = b''' __kernel void probe(read_only image3d_t image, __global const float4* input, __global uint4* output) { const uint id = get_global_id(0); const float4 coord = input[id]; output[id] = read_imageui(image, CLK_NORMALIZED_COORDS_TRUE | CLK_ADDRESS_REPEAT | CLK_FILTER_NEAREST, coord); } ''' source_ptr = c.c_char_p(source) source_len = Z(len(source)) program = create_source(context, 1, c.byref(source_ptr), c.byref(source_len), c.byref(err)) check(err.value, 'program') result = build(program, 1, c.byref(device), b'-cl-std=CL2.0', None, None) log_size = Z() check(build_info(program, device, 0x1183, 0, None, c.byref(log_size)), 'build log size') log = c.create_string_buffer(log_size.value) check(build_info(program, device, 0x1183, len(log), log, None), 'build log') print(log.value.decode()) check(result, 'build') binary_size = Z() check(program_info(program, 0x1165, c.sizeof(binary_size), c.byref(binary_size), None), 'binary size') binary = c.create_string_buffer(binary_size.value) binary_ptr = c.cast(binary, P) check(program_info(program, 0x1166, c.sizeof(binary_ptr), c.byref(binary_ptr), None), 'binary') path = Path(__file__).with_name('amd-opencl-texture-original.bin') path.write_bytes(binary.raw) print('binary', binary_size.value, binary.raw[:16].hex()) check(release_program(program), 'release program') check(release_context(context), 'release context') create_binary = bind('clCreateProgramWithBinary', P, [P, U, P, P, P, P, P]) create_queue = bind('clCreateCommandQueue', P, [P, P, Q, P]) create_buffer = bind('clCreateBuffer', P, [P, Q, Z, P, P]) create_image = bind('clCreateImage', P, [P, Q, P, P, P, P]) create_kernel = bind('clCreateKernel', P, [P, c.c_char_p, P]) set_arg = bind('clSetKernelArg', I, [P, U, Z, P]) enqueue = bind('clEnqueueNDRangeKernel', I, [P, P, U, P, P, P, U, P, P]) read_buffer = bind('clEnqueueReadBuffer', I, [P, P, U, Z, Z, P, U, P, P]) finish = bind('clFinish', I, [P]) release_mem = bind('clReleaseMemObject', I, [P]) release_kernel = bind('clReleaseKernel', I, [P]) release_queue = bind('clReleaseCommandQueue', I, [P]) class ImageFormat(c.Structure): _fields_ = [('order', U), ('type', U)] class ImageDescriptor(c.Structure): _fields_ = [('type', U), ('width', Z), ('height', Z), ('depth', Z), ('arraySize', Z), ('rowPitch', Z), ('slicePitch', Z), ('mips', U), ('samples', U), ('buffer', P)] native = bytearray(path.read_bytes()) sections_offset = struct.unpack_from('<Q', native, 40)[0] section_size, section_count, names_index = struct.unpack_from('<HHH', native, 58) headers = [struct.unpack_from('<IIQQQQIIQQ', native, sections_offset + i * section_size) for i in range(section_count)] names_header = headers[names_index] names = native[names_header[4]:names_header[4] + names_header[5]] sections = {names[s[0]:].split(b'\0', 1)[0].decode(): s for s in headers} text_start, text_size = sections['.text'][4:6] matches = [o for o in range(text_start, text_start + text_size, 4) if struct.unpack_from('<I', native, o)[0] == 0xf09c0f10] if len(matches) != 1: raise RuntimeError(f'expected one 3D image_sample_lz, found {matches}') sample_offset = matches[0] if struct.unpack_from('<I', native, sample_offset + 4)[0] != 0x00400000: raise RuntimeError('unexpected image/sampler/address register encoding') expected_init = {0x9ac: 0xbe8a0b84, 0x9b0: 0xbe8903ff, 0x9b4: 0x00fff000, 0x9c4: 0xbe8803ff, 0x9c8: 0x10003000} if sample_offset != 0x9f0: raise RuntimeError('compiler layout changed') for offset, value in expected_init.items(): if struct.unpack_from('<I', native, offset)[0] != value: raise RuntimeError(f'compiler sampler initialization changed at {offset:x}') for offset in range(0x9a0, sample_offset, 4): if offset not in expected_init: struct.pack_into('<I', native, offset, 0xbf800000) struct.pack_into('<I', native, sample_offset, 0xf0940f08) descriptor_offset = sections['.rodata'][4] rsrc1 = struct.unpack_from('<I', native, descriptor_offset + 48)[0] mask = (0xff << 12) | (1 << 21) | (1 << 23) | (1 << 26) rsrc1 = (rsrc1 & ~mask) | (0xf0 << 12) | (1 << 21) struct.pack_into('<I', native, descriptor_offset + 48, rsrc1) properties = struct.unpack_from('<H', native, descriptor_offset + 56)[0] print('native controls', hex(rsrc1), hex(properties), 'wave32', bool(properties & (1 << 10))) size = 16 texels = (U * (size * size))(*(0x1000000 + y * 256 + x for y in range(size) for x in range(size))) rows = [(bias, u, v, 0.0) for bias in (-16.0, -0.5, 0.0, 0.5, 16.0) for u, v in ((0.03125, 0.03125), (0.53125, 0.78125), (0.96875, 0.96875), (-0.03125, 1.03125))] inputs = (c.c_float * (len(rows) * 4))(*(v for row in rows for v in row)) report = {'device': 'gfx1036', 'driver': '32.0.21036.18', 'rows': rows, 'controls': {'wave32': bool(properties & (1 << 10)), 'ieee': 0, 'dx10_clamp': 1, 'denorm32': 3, 'denorm16': 3, 'round32': 0, 'round16': 0, 'fp16_overflow': 0}, 'cases': []} cases = [(r, d, "R32_UINT", False) for r in (0, 1, 2) for d in (0, 1)] + [(0, d, "RGBA8_UNORM", False) for d in (0, 1)] + [(1, 1, "R32_UINT", True)] cases += [(r, d, "RGBA8_UINT", False) for r in (0, 1, 2) for d in (0, 1)] cases.append((1, 1, "RGBA8_UINT", True)) cases.append((0, 0, "R32_UINT", False)) cases.append((0, 1, "R32_UINT", False)) for case_index, (reduction, degamma, format_name, exact_sampler) in enumerate(cases): data = bytearray(native) baseline = case_index >= len(cases) - 2 if baseline: struct.pack_into("<I", data, sample_offset, 0xf09c0f10) struct.pack_into('<I', data, 0x9c8, 0x10003000 | (reduction << 29) | (degamma << 20)) if exact_sampler: struct.pack_into('<I', data, 0x9c8, 0x20175700) struct.pack_into('<I', data, 0x9b4, 0x03800000) struct.pack_into('<I', data, 0x9ac, 0xbe8a0b80) struct.pack_into('<II', data, 0x9e4, 0xbe8b03ff, 0xa0500f2e) case_path = path.with_name(f'amd-opencl-bias-dim2d-{format_name}-r{reduction}-d{degamma}-exact{int(exact_sampler)}-baseline{int(baseline)}.bin') case_path.write_bytes(data) context = create_context(None, 1, c.byref(device), None, None, c.byref(err)) check(err.value, 'context') data_buffer = c.create_string_buffer(bytes(data)) data_pointer = c.cast(data_buffer, P) data_size = Z(len(data)) binary_status = I() program = create_binary(context, 1, c.byref(device), c.byref(data_size), c.byref(data_pointer), c.byref(binary_status), c.byref(err)) check(err.value, 'load native binary') check(binary_status.value, 'native binary status') check(build(program, 1, c.byref(device), None, None, None), 'build native binary') queue = create_queue(context, device, 0, c.byref(err)) check(err.value, 'queue') image_format = ImageFormat(0x10b0, 0x10dc) if format_name == "R32_UINT" else ImageFormat(0x10b5, 0x10da if format_name == "RGBA8_UINT" else 0x10d2) case_texels = texels if format_name == "R32_UINT" else (U * (size * size))(*(0xff208040 for _ in range(size * size))) image_descriptor = ImageDescriptor(0x10f2, size, size, 1, 0, 0, 0, 0, 0, None) image = P(create_image(context, 4 | 32, c.byref(image_format), c.byref(image_descriptor), case_texels, c.byref(err))) check(err.value, 'image') input_buffer = P(create_buffer(context, 4 | 32, c.sizeof(inputs), inputs, c.byref(err))) check(err.value, 'input') output = (U * (len(rows) * 4))() output_buffer = P(create_buffer(context, 1, c.sizeof(output), None, c.byref(err))) check(err.value, 'output') kernel = create_kernel(program, b'probe', c.byref(err)) check(err.value, 'kernel') for index, value in enumerate((image, input_buffer, output_buffer)): check(set_arg(kernel, index, c.sizeof(value), c.byref(value)), 'argument') global_size = Z(len(rows)) check(enqueue(queue, kernel, 1, None, c.byref(global_size), None, 0, None, None), 'enqueue') check(read_buffer(queue, output_buffer, 1, 0, c.sizeof(output), output, 0, None, None), 'read output') check(finish(queue), 'finish') results = [list(output[i:i + 4]) for i in range(0, len(output), 4)] print('measurement', format_name, reduction, degamma, 'exact', exact_sampler, 'baseline', baseline, results) report['cases'].append({'format': format_name, 'reduction': reduction, 'force_degamma': degamma, 'exact_game_sampler': exact_sampler, 'baseline_lz_dim3d': baseline, 'output': results}) for memory in (image, input_buffer, output_buffer): check(release_mem(memory), 'release memory') check(release_kernel(kernel), 'release kernel') check(release_queue(queue), 'release queue') check(release_program(program), 'release program') check(release_context(context), 'release context') path.with_name('amd-opencl-texture-measurement.json').write_text(json.dumps(report, indent=2), encoding='utf-8') ``` </details>
ymatrix1 commented 2026-10-13 23:59:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ymatrix1 on 2026-10-13T23:59:18Z.


PS5 (gfx1013) measurements for a 2D image instruction over a 3D descriptor, since the description notes gfx1013 was not measured. Kena: Bridge of Spirits (PPSA01746) binds a 1x1x1 3D texture to a slot read by image_sample_b ... dim:2D, which is what stops it without this change.

Method: the PS5 Vulkan probe harness (mihawk-99/PS5_Vulkan) on a console. A 64x4x4 linear volume with four distinct slices, read by a compute shader whose instructions are dim:2D, with the T# rewritten to TYPE 3D (10), height 4, depth 4 before the dispatch. Counts are of the 256 output texels per slice.

access (all dim:2D) slice 0 other slices
image_load 256 0
image_sample_lz, nearest sampler 256 0
image_sample_lz, linear sampler 256 0, none blended
image_sample_l with LOD 3.0 in the register after the coordinates 256 0, the register is not read as Z
control: image_load dim:3D at z = 2 0 256 from slice 2

These are the first three accesses only; image_sample_b itself is not in this run. They agree with your gfx1036 result that the absent third coordinate reads slice 0. I also have a branch that adds image_load / image_sample_lz / image_sample_l over a 3D descriptor of any depth, built on the same mode: ymatrix1:fix/shader-2d-image-on-3d-descriptor (commit ed38ecbf7). It overlaps this PR in ResourceMaterializer.cpp, ResourceTracker.cpp and the disk-cache format, so I'll rebase it on this one once it lands rather than open a competing PR.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6157753338 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5461#issuecomment-6157753338). Originally posted by [ymatrix1](https://github.com/ymatrix1) on 2026-10-13T23:59:18Z. --- PS5 (gfx1013) measurements for a 2D image instruction over a 3D descriptor, since the description notes gfx1013 was not measured. Kena: Bridge of Spirits (PPSA01746) binds a 1x1x1 3D texture to a slot read by `image_sample_b ... dim:2D`, which is what stops it without this change. Method: the PS5 Vulkan probe harness (mihawk-99/PS5_Vulkan) on a console. A 64x4x4 linear volume with four distinct slices, read by a compute shader whose instructions are `dim:2D`, with the T# rewritten to TYPE 3D (10), height 4, depth 4 before the dispatch. Counts are of the 256 output texels per slice. | access (all `dim:2D`) | slice 0 | other slices | |---|---|---| | `image_load` | 256 | 0 | | `image_sample_lz`, nearest sampler | 256 | 0 | | `image_sample_lz`, linear sampler | 256 | 0, none blended | | `image_sample_l` with LOD 3.0 in the register after the coordinates | 256 | 0, the register is not read as Z | | control: `image_load dim:3D` at z = 2 | 0 | 256 from slice 2 | These are the first three accesses only; `image_sample_b` itself is not in this run. They agree with your gfx1036 result that the absent third coordinate reads slice 0. I also have a branch that adds `image_load` / `image_sample_lz` / `image_sample_l` over a 3D descriptor of any depth, built on the same mode: [`ymatrix1:fix/shader-2d-image-on-3d-descriptor`](https://github.com/ymatrix1/AnyPS5/tree/fix/shader-2d-image-on-3d-descriptor) (commit [`ed38ecbf7`](https://github.com/ymatrix1/AnyPS5/commit/ed38ecbf7)). It overlaps this PR in `ResourceMaterializer.cpp`, `ResourceTracker.cpp` and the disk-cache format, so I'll rebase it on this one once it lands rather than open a competing PR. AI-assisted: yes.
adriadam10 commented 2026-10-14 20:03:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T20:03:42Z.


Checked on the PR rebased onto main: agc_shader_disk_cache and agc_driver_image_plane_bias_on_single_level_volume pass, and the new test does not build without the change. Measured on gfx1035: image_sample_b DIM 2D over a one-slice, single-level 3D T# with a point sampler, biases -16/-0.5/0/0.5/16, wrap and clamp, 80/80 rows read the (u,v) texel of slice 0, as the PR assumes.

Added as our own commits on your branch:

  • Rebase onto main: shader cache format 35, ImageResource has 37 fields, DescriptorBindingBuilder keeps main's sampler.table skip before your check.
  • ResourceMaterializer.cpp: main replaced indirectRoot with table, so the mode now requires image.table == NoTable.
  • docs/dev/debt/shader.md: moved the new line away from the end of the section to avoid adjacency conflicts.

Merging once the full build is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177229865 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5461#issuecomment-6177229865). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-14T20:03:42Z. --- Checked on the PR rebased onto main: `agc_shader_disk_cache` and `agc_driver_image_plane_bias_on_single_level_volume` pass, and the new test does not build without the change. Measured on gfx1035: `image_sample_b` DIM 2D over a one-slice, single-level 3D T# with a point sampler, biases -16/-0.5/0/0.5/16, wrap and clamp, 80/80 rows read the (u,v) texel of slice 0, as the PR assumes. Added as our own commits on your branch: - Rebase onto main: shader cache format 35, `ImageResource` has 37 fields, `DescriptorBindingBuilder` keeps main's `sampler.table` skip before your check. - `ResourceMaterializer.cpp`: main replaced `indirectRoot` with `table`, so the mode now requires `image.table == NoTable`. - `docs/dev/debt/shader.md`: moved the new line away from the end of the section to avoid adjacency conflicts. Merging once the full build is green.
github-actions[bot] commented 2026-10-14 20:17:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T20:17:16Z.


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
#6032 core/shader/recompiler/ShaderDiskCache.hpp L16
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6177490819 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5461#issuecomment-6177490819). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-14T20:17:16Z. --- <!-- 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 | |---|---|---|---| | #6032 | `core/shader/recompiler/ShaderDiskCache.hpp` [L16](https://github.com/boykopovar/AnyPS5/blob/03f49fcf2e90a765551a1d7f36fbde4b5409300b/core/shader/recompiler/ShaderDiskCache.hpp#L16) | | |
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!5461
No description provided.