2D image access bound to a 1D T#: image descriptor is incompatible with the static runtime image interface #2237
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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:
Setup: Linux, RX 9070 XT (RADV). Base is
main43972e69plus #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)Dim2D, sampled, float.Dim2DandDim3D× float/sint/uint (plus conversion variants).Dim1D, float, no conversion, not packed, not cube, no depth.05567600 04d00000 00000000 81b00fac 00000000 00700000 00000000 00000000TYPE(dword 3, bits 31:28) = 8,SQ_RSRC_IMG_1D.So none of the modes matches, and the draw throws.
What would settle it
The console's result for a 2D
image_sample*(andimage_load, if it shows up) through a 1D T#. By analogy with #2023, it would probably read row 0, usinguand ignoringv, 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-oraclehere, 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.
Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-09T17:44:58Z.
Measured on RDNA2 with
tools/hw-oracleatmaind70b8998: 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
extraafter the rows and the T# and S# built in SGPRs: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):image_sample_lzdim 2D, u at texels 0, 3, 7, v = 0, 0.5, 1, 1.5, -0.25, 3image_sample_lzdim 2D, u = 1.25 and -0.25, v = 0.5image_loaddim 2D, x = 0, 3, 7, y = 0, 1, 2, 3, -1image_loaddim 2D, x = 8The HEIGHT = 3 and DEPTH = 3 copies give the same results: v and y select no row and no slice. Controls: dim 1D
image_sample_lzandimage_loadthrough 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.mdlists the MIMG encodings as shared with gfx1013 but says nothing about T# fields. The fields set here are at the positionsGuestTextureResource.cppdecodes 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. Onlyimage_sample_lzandimage_loadwere measured.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_lzaddresses 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_loadaddresses with x only. Any y returns the x texel, even y = -1. x past the width returns 0.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.ymllanded 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.