fix(shader): honor explicit LOD on 3D samples of 1D textures #28324
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28324"
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 DannyOppenheimer on 2026-11-30T05:04:53Z.
What
A shader that issues
image_sample_lwith DIM 3D can bind a 1D texture. Main rejects that binding during resource materialization. An RX 5700 XT sampled the same mip as a native DIM 1D instruction when the two instructions shared the descriptor, sampler, u coordinate and explicit LOD.Allow the exact explicit-LOD sample flag in the existing 3D-on-1D compatibility check. The existing sampling path supplies u and the instruction's LOD to the 1D image. Combined flags, including comparison and offset, retain their existing checks. This extends the plain and level-zero samples covered by #5375.
The overlap check flagged shared tracker lines in #7085 and #28176 (extra mip backing), and #10867 adjusts the compute target in the former refusal test. Those patches address different behavior.
The execution test replaces its explicit-LOD refusal assertion with a three-level texture. Each dispatch requests one mip with u fixed and sweeps v and r independently. It checks RGBA for every lane.
Tested
Hardware oracle. AMD Radeon RX 5700 XT (Navi 10, gfx1010), Windows 11 build 26200, AMD driver 32.0.21045.5002. The probe used a 64-texel linear RGBA8 UNORM 1D texture, point mip filtering, wrap addressing and u = 0.375. Both instructions ran in each lane, with the 1D form as the control. For each requested LOD, v and r independently covered {-0.25, 0, 0.5, 1, 1.5}.
All four raw float channels matched on all 75 rows, in two wave32 runs and one wave64 run. Fractional LODs and other sampler modes were outside this measurement.
Reproduce the native measurement with tools/hw-oracle
Save the following script and run
python measure.py <AnyPS5 checkout>with the RX 5700 XT selected viaHIP_VISIBLE_DEVICES. It records the per-lane channel bits inresults.jsonnext to the script.Vulkan execution. Built the focused target with WinLibs GCC and ran
ctest --test-dir build -R '^agc_driver_image_volume_address_on_line$' -Vat main4025563419and at53c5f9cdd1on the same RX 5700 XT. Both passed withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LOADER_DEBUG=layer. Both logs show insertion of validation layer 1.4.369, zero missing-layer warnings and zeroVUID-messages. Main exercises the old refusal. The branch checks the sampled colors.python tools/check_conventions.pypassed. No game was tested.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 file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T05:13:24Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
53c5f9cdd18dba7db197c23acc10c09637966f3f. I read the prepared description, commits, diff, manifest, and all added lines in the three changed files, plus the resource materializer compatibility logic. No tests or builds were run by me; the hardware and Vulkan runs described in the PR were author-reported.Results
Findings
Blocking
None.
Non-blocking
Not verified
I did not run builds, tests, or the hardware oracle. I read all changed files listed in the manifest; no changed files were excluded. The referenced
files.jsonwas not available through the reader, so excluded-by-rule details are not verified.To get this to a good state
Nothing is required. Optional: extend hardware coverage to fractional LODs and additional sampler modes if those are needed.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-03T10:38:45Z.
Review: APPROVED
I read the diff at
53c5f9cdd1. Windows 11, GCC 15.2, merged intomainatb97867d3ce6together with other open PRs (so not an isolated build), withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1andVK_LAYER_KHRONOS_validationon an RTX 5080 (621.24) and a Radeon iGPU (26.11.2).agc_driver_image_volume_address_on_line: pass on both GPUs. The loader log shows the layer inserted and no "was not found" line, and neither run has aVUID-orSYNC-HAZARDline.main's): fails on both GPUs: "image descriptor is incompatible with the static runtime image interface".Not checked: a title.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T14:53:30Z.
Review: COMMENTED
Ran the GCN scalar-buffer CTest on
mainand this head integrated using lavapipe. It passed on both runs. The branch's newagc_driver_image_volume_address_on_linetest also passed, covering explicit LOD with 3D sampling of a line texture. The requested Khronos validation 1.4.369 layer was inserted in all three logs, with no missing-layer diagnostic orVUID-messages.AI-assisted: yes.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.