fix(shader): read 1D T#s through 3D image_sample and image_load accesses #5375
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5375"
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 billythemenace2 on 2026-10-13T18:19:28Z.
What
A 3D image access bound to a 1D T# matched no runtime image mode and threw "image descriptor is incompatible with the static runtime image interface". SONIC SUPERSTARS (PPSA06888) reads a 1x1 1D T# (type 8, format 7) as 3D.
This adds a 1D mode for 3D accesses whose only uses are
image_sample_lz, plainimage_sampleor mip-lessimage_load, as measured on RDNA1 (RX 5700 XT, gfx1010) with the [hardware oracle](docs/dev/HW_ORACLE.md):image_sample_lzreads the texel u selects and ignores v and r, with wrap, clamp-last-texel and border addressing.image_sampletakes its texel and LOD from u alone.image_loadreads the x texel for any y when z is 0 and returns zero for any other z, as the 3D-on-2D load measured in #2023 does.Every other 3D access of such an image keeps throwing, including comparison samples (
image_sample_c*), explicit LOD, bias, derivatives, offsets, gathers, queries and stores. The raw measurement is attached.measurement-results-3d-on-1d.md
This completes the set after #2237 (2D on 1D) and #2023 (3D on 2D). The measured GPU is RDNA1, the same family as the PS5's gfx1013; the earlier two cases were measured on RDNA2.
Tested
agc_driver_image_volume_address_on_lineexecution test passes.agc_driver_image_volume_address_on_lineandagc_shader_disk_cachepass. On this Windows driver,agc_driver_image_plane_address_on_line,..._on_line_implicit_lod,agc_driver_image_volume_address_on_planeand..._planar_texturefail with zero texels on plainmaintoo, without this change.main+ this PR + #4474. The 3D-on-1D sample and load accesses no longer refuse; the title still stops at a 3D comparison sample on the same kind of 1D T#, which this PR leaves refused because it is not measured.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with [Claude Code](https://claude.com/claude-code)
Imported from boykopovar/AnyPS5. Originally posted by mrfelek on 2026-10-14T12:50:22Z.
Correction to this comment
I misread the dimension in my first version of this report. In
RdnaImageDimension,dim 3isDim2D(Dim3Dis 4), so the Castlevania: Belmont's Curse (PPSA35399) stop was a DIM 2D depth-compare sample (depthCompare=1) on a 1x1 1D T# (type 8, format 7), not a 3D comparison.That is the case #5456 covers, with the same error text in its description. #5456 is merged, and on
main8f9240f06(with #5375 and #5456 both in, no other changes) the title gets past it and reaches gameplay (screenshot and details in discussion #5832).What I wrote before about this PR leaving "the 3D comparison" refused, and about no open PR covering it, does not apply to Castlevania. Sorry for the noise.
AI-assisted; the runs are from my machine.
Imported from boykopovar/AnyPS5. Originally posted by KauaSantos702 on 2026-10-14T13:45:33Z.
NVIDIA run at this head (
0bcc6b4e1), adding a vendor to the AMD results in the body: noagc_*test fails.BUILD_TESTING=ONctest -R '^agc_' -j2: 484 tests, 483 passed, 0 failed, 1 skipped. The skipped test isagc_driver_stencil_ref_export, because the device lacksVK_EXT_shader_stencil_export; it is also skipped onmain.Imported from boykopovar/AnyPS5. Originally posted by billythemenace2 on 2026-10-14T15:51:43Z.
@mrfelek Thanks for the second title.
Rebase: done in
deb60d761, onmain066b58fa1.fieldCount<ImageResource>()is 38, the minimum image record is 76 bytes, andFormatVersionis 32, since this PR changes the encoded info.agc_driver_image_volume_address_on_line,agc_shader_disk_cacheandagc_shader_memorypass on an RX 5700 XT.DIM 3D comparison on a 1D T#: right, this PR adds only the plain sample and the load, and keeps
image_sample_c*through DIM 3D refused. That access needs its own hardware measurement before it can be modeled, the way #5456 measured the DIM 2D comparison, so it belongs in a separate PR rather than in this one.AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-14T18:37:10Z.
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.
main)core/shader/recompiler/Optimization/src/ResourceTracker.cppL1510docs/dev/debt/shader.mdL70core/shader/recompiler/Optimization/src/ResourceTracker.cppL1510docs/dev/debt/shader.mdL70Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T19:16:08Z.
Checked the 3D-on-1D forms on the HW oracle (gfx1035):
image_sample_lzwith v and r ignored under clamp, wrap and border,image_loadreturning zero for z ≠ 0 and for x past the width, and an implicit-LODimage_samplewhose LOD comes from u alone. All of them match DIM 1D bit for bit, as you measured on gfx1010. Full ctest passes, the new test also passes on CI's lavapipe, and it fails without the change, including when only the emitter's z check is removed. Merging.