Repository navigation
fix(shader): bind 2D textures to 3D sample and load accesses as measured - #2133
Merged
adriadam10 merged 2 commits intoOct 10, 2026
Merged
Conversation
9 tasks done
Contributor
|
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
AI-assisted: yes |
Contributor
|
Tested with Sonic Origins (PPSA05324) on Linux, R9 380 (RADV, Mesa 26.0.8, GFX8): yes, it gets past the stop.
I tested #2140 the same way; it also gets the title past this stop. Bring-up thread: #2021 |
9 tasks done
9 tasks done
This was referenced Oct 9, 2026
A 3D image access bound to a 2D T# matched no runtime image mode and threw "image descriptor is incompatible with the static runtime image interface" (Sonic Origins, boykopovar#2023). CouchRiv measured RDNA2 (gfx1036) with the hardware oracle: image_sample_lz with dim 3D ignores r and reads the (u,v) texel, and image_load reads the (x,y) texel when z is 0 and returns zero otherwise. Add a 2D mode for 3D accesses whose only uses are those two forms, and make the load return zero for z != 0. Every other access keeps throwing. Fixes boykopovar#2023 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
Collaborator
|
Checked on our side:
Added on your branch:
Merging once the full Linux and Windows build is green. |
adriadam10
force-pushed
the
fix/agc-3d-access-on-2d-texture
branch
from
October 10, 2026 06:13
c1b85fb to
090a30c
Compare
|
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.
|
This was referenced Oct 10, 2026
SleglJan
pushed a commit
to SleglJan/AnyPS5
that referenced
this pull request
Oct 10, 2026
…2d-texture fix(shader): bind 2D textures to 3D sample and load accesses as measured
overlordxrz-source
added a commit
to overlordxrz-source/AnyPS5
that referenced
this pull request
Oct 11, 2026
Since boykopovar#2133, a 3D image_sample_lz or image_load bound to a 2D-array T# decodes as 2D and matches the new 2D mode, so it reads layer 0 for any r and returns zero for z != 0. adriadam10 measured on RDNA2 (gfx1035) that dim 3D on a 2D-array T# behaves exactly like dim 2D-array, with r or z as the layer. Decode a 2D-array T# bound to a 3D access as 2D-array and add a 2D-array mode next to the 2D one. The same measurement covers image_load_mip on both T# types and image_get_resinfo, which returns (w, h, 1, levels) on a 2D T# and (w, h, layers, levels) on a 2D-array T#. Allow those accesses and return 1 as the third resinfo component through the 2D mode. image_get_lod is not measured and keeps throwing.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes #2023. A 3D image access bound to a 2D T# matched no runtime image mode and threw "image descriptor is incompatible with the static runtime image interface" (Sonic Origins PPSA05324).
RuntimeImageModesalready offers a 3D mode for a 2D access, but not the reverse.Semantics source: CouchRiv's hardware-oracle measurement in #2023 on RDNA2 (gfx1036):
image_sample_lzwith dim 3D on a 2D T# returns the (u,v) texel for every r.image_loadwith dim 3D returns the (x,y) texel for z = 0 and zeros otherwise.Change:
flatVolumeCompatibleimage flag, narrowed inResourceTracker::Merge, stays true only while every use of the image is one of those two measured forms: animage_sample_lzwith no other sample flags, or animage_loadwithout mip, packing or BY.RuntimeImageModesadds a 2D mode: not storage, not depth, no conversion or packed format.EmitReadOpnow returns zero when z != 0.image_load_mip) keeps throwing. Recorded in TechnicalDebt, including that gfx1013 is not measured.Tested
Linux, lavapipe (Mesa 25.2.8), main at a7ff885.
agc_driver_image_volume_address_on_plane:image_sample_lzwith r in {0, 0.5, 1, 1.5, -0.25, 3, 0.25, 0.75} and expect the (u,v) texel.image_loadwith z in {0, 1, 2, 3, 4, -1} and expect the texel for z = 0 and zeros otherwise.image_sample_lon the 2D T# is still refused.agc_driver_image_*,runtime_imagesandbindless_imagesexecution tests,agc_shader_disk_cache(now round-trips the flag),agc_driver,agc_shader_memoryandagc_driver_graphicspass.tools/check_conventions.pyandtools/check_test_registration.pypass.Checklist