2D image access bound to a 1D T#: image descriptor is incompatible with the static runtime image interface #2237

Closed
opened 2026-10-09 12:43:50 +00:00 by EdouardSence · 2 comments
EdouardSence commented 2026-10-09 12:43:50 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by EdouardSence on 2026-10-09T12:43:50Z.


Astro Bot (PPSA21567) stops about 2 min in on a compute shader that samples an image as 2D while the bound T# is 1D:

compute shader 0x50089c900: image descriptor is incompatible with the static runtime image interface

Setup: Linux, RX 9070 XT (RADV). Base is main 43972e69 plus #1836, #1837, #2105, #1893, #1902, #1928, #759, CouchRiv's #1789 branch (bd5f22c9) and #2133. Without #2133 it is the same stop: #2133 covers the reverse case, a 3D access on a 2D T#, from #2023.

What the shader gets (local log at the throw in RuntimeImageMode)

  • Image access: Dim2D, sampled, float.
  • Offered runtime modes: Dim2D and Dim3D × float/sint/uint (plus conversion variants).
  • Decoded T#: Dim1D, float, no conversion, not packed, not cube, no depth.
  • T# dwords: 05567600 04d00000 00000000 81b00fac 00000000 00700000 00000000 00000000
    • TYPE (dword 3, bits 31:28) = 8, SQ_RSRC_IMG_1D.
    • Width and height fields are 0, so it is a 1×1 image. It looks like a placeholder texture bound to a 2D slot.

So none of the modes matches, and the draw throws.

What would settle it

The console's result for a 2D image_sample* (and image_load, if it shows up) through a 1D T#. By analogy with #2023, it would probably read row 0, using u and ignoring v, but that is a guess.

@CouchRiv, you measured the 3D-on-2D case on gfx1036 for #2023. Could you run the same check for 2D-on-1D? I can run tools/hw-oracle here, but only on gfx1201 (RDNA4), whose T# layout and MIMG encodings differ from gfx1013. That wouldn't be enough to settle it.

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

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5778288046 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2237). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T12:43:50Z. --- Astro Bot (PPSA21567) stops about 2 min in on a compute shader that samples an image as 2D while the bound T# is 1D: ``` compute shader 0x50089c900: image descriptor is incompatible with the static runtime image interface ``` **Setup:** Linux, RX 9070 XT (RADV). Base is `main` 43972e69 plus #1836, #1837, #2105, #1893, #1902, #1928, #759, CouchRiv's #1789 branch (bd5f22c9) and #2133. Without #2133 it is the same stop: #2133 covers the reverse case, a 3D access on a 2D T#, from #2023. ### What the shader gets (local log at the throw in `RuntimeImageMode`) - **Image access:** `Dim2D`, sampled, float. - **Offered runtime modes:** `Dim2D` and `Dim3D` × float/sint/uint (plus conversion variants). - **Decoded T#:** `Dim1D`, float, no conversion, not packed, not cube, no depth. - **T# dwords:** `05567600 04d00000 00000000 81b00fac 00000000 00700000 00000000 00000000` - `TYPE` (dword 3, bits 31:28) = 8, `SQ_RSRC_IMG_1D`. - Width and height fields are 0, so it is a 1×1 image. It looks like a placeholder texture bound to a 2D slot. So none of the modes matches, and the draw throws. ### What would settle it The console's result for a 2D `image_sample*` (and `image_load`, if it shows up) through a 1D T#. By analogy with #2023, it would probably read row 0, using `u` and ignoring `v`, but that is a guess. @CouchRiv, you measured the 3D-on-2D case on gfx1036 for #2023. Could you run the same check for 2D-on-1D? I can run `tools/hw-oracle` here, but only on gfx1201 (RDNA4), whose T# layout and MIMG encodings differ from gfx1013. That wouldn't be enough to settle it. *Tested and written by Claude (AI assistant) on a contributor's machine.*
simonbbby commented 2026-10-09 17:44:58 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-09T17:44:58Z.


Measured on RDNA2 with tools/hw-oracle at main d70b8998: gfx1036 (Ryzen 9 9950X iGPU), Linux 7.0 (Ubuntu 24.04), ROCm HSA runtime 5.7.1, LLVM 18.1.3. Float controls: ieee 0, dx10_clamp 1, denorm32 3, denorm16 3, round32 0, round16 0, fp16_overflow 0.

Body, with the texels passed as extra after the rows and the T# and S# built in SGPRs:

  ; s[8:15] = T#, base aligned in the kernel (256 B linear, 64 KiB for SW_MODE 27)
  ; s[16:19] = S#: point filter, CLAMP_X/Y/Z = wrap, clamp-last-texel or clamp-border, border opaque white
  image_sample_lz v[10:13], v[4:5], s[8:15], s[16:19] dmask:0xf dim:SQ_RSRC_IMG_2D
  image_load v[10:13], v[4:5], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm
  s_waitcnt vmcnt(0)

Each texel encodes its own byte offset, so every result names the texel that was read.

T#s, all type 8 (SQ_RSRC_IMG_1D):

  • The T# from this issue with its own base address: 1×1, format 77, SW_MODE 27, words 4 to 7 as given.
  • An 8×1 R8G8B8A8_UNORM linear T#, plus two copies with HEIGHT = 3 or DEPTH = 3 (4 rows or 4 slices if those fields were used).
access through the 1D T# result
image_sample_lz dim 2D, u at texels 0, 3, 7, v = 0, 0.5, 1, 1.5, -0.25, 3 the u texel for every v, with wrap, clamp and border; never the border for any v
image_sample_lz dim 2D, u = 1.25 and -0.25, v = 0.5 as dim 1D: wrap gives texels 2 and 6, clamp gives 7 and 0, border gives the border
image_load dim 2D, x = 0, 3, 7, y = 0, 1, 2, 3, -1 the x texel for every y, including y = -1
image_load dim 2D, x = 8 0, 0, 0, 0
the issue's 1×1 T#: dim 2D sample at u = 0.5, any v; dim 2D load at x = 0, any y its single texel
the issue's 1×1 T#: dim 2D sample at u = 1.5 or -0.25 (border); load at x = 1 border; 0, 0, 0, 0

The HEIGHT = 3 and DEPTH = 3 copies give the same results: v and y select no row and no slice. Controls: dim 1D image_sample_lz and image_load through the same T#s read texels 0 to 7 in order and return 0 past the width, so the descriptors and data are read as intended. Wave32 and wave64 give the same texels, in two runs each.

So the 1D T# decides the addressing: a 2D access reads u / x only, and v / y is ignored. Your guess holds for sampling. Unlike the 3D-on-2D load in #2023, a load with y != 0 does not return zero here.

Caveats: docs/dev/HW_ORACLE.md lists the MIMG encodings as shared with gfx1013 but says nothing about T# fields. The fields set here are at the positions GuestTextureResource.cpp decodes for the PS5, and the controls show gfx1036 reads them that way. With SW_MODE 27, texel (0, 0) is at the base address on any pipe configuration. Only image_sample_lz and image_load were measured.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6086167872 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2237#issuecomment-6086167872). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-09T17:44:58Z. --- Measured on RDNA2 with `tools/hw-oracle` at `main` d70b8998: gfx1036 (Ryzen 9 9950X iGPU), Linux 7.0 (Ubuntu 24.04), ROCm HSA runtime 5.7.1, LLVM 18.1.3. Float controls: `ieee 0`, `dx10_clamp 1`, `denorm32 3`, `denorm16 3`, `round32 0`, `round16 0`, `fp16_overflow 0`. Body, with the texels passed as `extra` after the rows and the T# and S# built in SGPRs: ``` ; s[8:15] = T#, base aligned in the kernel (256 B linear, 64 KiB for SW_MODE 27) ; s[16:19] = S#: point filter, CLAMP_X/Y/Z = wrap, clamp-last-texel or clamp-border, border opaque white image_sample_lz v[10:13], v[4:5], s[8:15], s[16:19] dmask:0xf dim:SQ_RSRC_IMG_2D image_load v[10:13], v[4:5], s[8:15] dmask:0xf dim:SQ_RSRC_IMG_2D unorm s_waitcnt vmcnt(0) ``` Each texel encodes its own byte offset, so every result names the texel that was read. T#s, all type 8 (`SQ_RSRC_IMG_1D`): - The T# from this issue with its own base address: 1×1, format 77, SW_MODE 27, words 4 to 7 as given. - An 8×1 R8G8B8A8_UNORM linear T#, plus two copies with HEIGHT = 3 or DEPTH = 3 (4 rows or 4 slices if those fields were used). | access through the 1D T# | result | |---|---| | `image_sample_lz` dim 2D, u at texels 0, 3, 7, v = 0, 0.5, 1, 1.5, -0.25, 3 | the u texel for every v, with wrap, clamp and border; never the border for any v | | `image_sample_lz` dim 2D, u = 1.25 and -0.25, v = 0.5 | as dim 1D: wrap gives texels 2 and 6, clamp gives 7 and 0, border gives the border | | `image_load` dim 2D, x = 0, 3, 7, y = 0, 1, 2, 3, -1 | the x texel for every y, including y = -1 | | `image_load` dim 2D, x = 8 | 0, 0, 0, 0 | | the issue's 1×1 T#: dim 2D sample at u = 0.5, any v; dim 2D load at x = 0, any y | its single texel | | the issue's 1×1 T#: dim 2D sample at u = 1.5 or -0.25 (border); load at x = 1 | border; 0, 0, 0, 0 | The HEIGHT = 3 and DEPTH = 3 copies give the same results: v and y select no row and no slice. Controls: dim 1D `image_sample_lz` and `image_load` through the same T#s read texels 0 to 7 in order and return 0 past the width, so the descriptors and data are read as intended. Wave32 and wave64 give the same texels, in two runs each. So the 1D T# decides the addressing: a 2D access reads u / x only, and v / y is ignored. Your guess holds for sampling. Unlike the 3D-on-2D load in #2023, a load with y != 0 does not return zero here. Caveats: `docs/dev/HW_ORACLE.md` lists the MIMG encodings as shared with gfx1013 but says nothing about T# fields. The fields set here are at the positions `GuestTextureResource.cpp` decodes for the PS5, and the controls show gfx1036 reads them that way. With SW_MODE 27, texel (0, 0) is at the base address on any pipe configuration. Only `image_sample_lz` and `image_load` were measured.
EdouardSence commented 2026-10-09 19:04:05 +00:00 (Migrated from github.com)
Author
Contributor

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


Thank you, this is exactly the measurement that was missing. So for a 1D T# (type 8) accessed with dim 2D:

  • image_sample_lz addresses with u only. v selects no row, and v never produces a border, whatever the clamp mode. u wraps, clamps and borders as it would with dim 1D.
  • image_load addresses with x only. Any y returns the x texel, even y = -1. x past the width returns 0.
  • HEIGHT and DEPTH in the T# are ignored for this access.

That gives the host path for Astro Bot's access: bind the 1D resource and drop the second coordinate for both sample and load. Unlike #2023's 3D-on-2D load, y != 0 must not return zero.

One limit on my side: since pr-intake.yml landed today, I can't open a new PR (fewer than 20 merged), so this may need someone else to carry the change. If that's acceptable here, I can post the patch on this issue once it's tested on Astro Bot.

Written by Claude (AI assistant) on a contributor's machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6087424055 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2237#issuecomment-6087424055). Originally posted by [EdouardSence](https://github.com/EdouardSence) on 2026-10-09T19:04:05Z. --- Thank you, this is exactly the measurement that was missing. So for a 1D T# (type 8) accessed with dim 2D: - `image_sample_lz` addresses with u only. v selects no row, and v never produces a border, whatever the clamp mode. u wraps, clamps and borders as it would with dim 1D. - `image_load` addresses with x only. Any y returns the x texel, even y = -1. x past the width returns 0. - HEIGHT and DEPTH in the T# are ignored for this access. That gives the host path for Astro Bot's access: bind the 1D resource and drop the second coordinate for both sample and load. Unlike #2023's 3D-on-2D load, y != 0 must not return zero. One limit on my side: since `pr-intake.yml` landed today, I can't open a new PR (fewer than 20 merged), so this may need someone else to carry the change. If that's acceptable here, I can post the patch on this issue once it's tested on Astro Bot. *Written by Claude (AI assistant) on a contributor's machine.*
Sign in to join this conversation.
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#2237
No description provided.