fix(shader): read explicit-LOD 2D samples through 1D T#s as measured #5583
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5583"
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 mitul72 on 2026-10-14T00:16:42Z.
What
A 2D
image_sample_lthrough a 1D T# now takes the 1D runtime mode, asimage_sample_lzalready does, instead of failing the runtime image interface.Source: hardware measurement on RDNA2 (gfx1036) with
tools/hw-oracle, against the same sample with DIM 1D. u inside, on and past the edges; v of 0, 0.5, 1, -0.25 and 3; LOD -1 to 6 on a 5-level R32_FLOAT texture; point, linear and linear-mip filtering; wrap, clamp and border addressing; HEIGHT or DEPTH 3. All 4725 rows matched: the 1D T# decides the addressing and v is ignored.docs/dev/debt/shader.mdis updated accordingly.Test:
ImagePlaneAddressOnLinesamples a 5-level 1D T# with distinct mip contents at LODs -1 to 6 (fractional included) under point filtering with wrap and clamp and linear-mip filtering with wrap, clamp and border. Each result must equal the sameimage_sample_lwith DIM 1D bit for bit; point results must also be the expected texel of the expected level, linear-mip results the blend of the two selected levels.Tested
Linux, RX 9060 XT (RADV GFX12, local Mesa). Full
ctestpasses exceptagc_driver_tessellation, which segfaults inside RADV while linking pipeline libraries on unmodified upstream703aa8f63as well.Astro Bot (PPSA21567): without this change the title throws this refusal before the crash-site hub on
main+ #454.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)ResourceTracker.cppand thedocs/dev/debt/shader.mdentry. The behaviours are independent: explicit LOD is its own condition and only feedsflatLineCompatible, so it widens neither #5375's 3D path nor #5456's compare path. Whichever merges later combines the conditions and appends its sentence to the entry.🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-14T08:30:03Z.
Runs for this PR at head
a98b06534. Windows 11, MinGW-w64 GCC 15.2.0 Release, two GPUs in one machine: Intel UHD Graphics 770 (driver 32.0.101.6129, picked withANYPS5_GPU=Intel) and RTX 4090 (NVIDIA 616.92).agc_driver_image_plane_address_on_line) pass on both GPUs.ctest -R "agc_driver|agc_masked|agc_shader" -j4: no failures on either GPU. Intel: 387 tests, 28 skipped. NVIDIA: 387 tests, 1 skipped (agc_driver_stencil_ref_export). The skips are the same as onmainwith each GPU. On the UHD 770 they are features it doesn't support: f64, 64-bit and float atomics, mesh shaders, fp16 interpolation and dot, shader clock.No difference between the two GPUs.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T22:16:21Z.
@mitul72 I rebased this onto main and combined the condition and the debt entry with #5375 and #5456 (
lineSampleFlagskept, explicit LOD feeds onlyflatLineCompatible): oneandonlydean/AnyPS5@e52e140f5c, branchrebase/5583-sample-through-1d. The branch here doesn't take maintainer pushes, so could you reset it to that commit? Tests pass.Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-15T04:04:02Z.
The merged commit
e52e140f5fails its own new linear-mip check on NVIDIA, deterministically. Windows 11 10.0.26200, RTX 4090 (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 r7, Release,BUILD_TESTING=ON:mainate52e140f5itself:agc_driver_image_plane_address_on_linefails 3 of 3. Its parent4808d9c20passes (two builds on it today, with #5851 and with #6060's earlier head, neither touching the shader recompiler). Currentmaina077a88dffails 8 of 8, same message, with #6060 or #6168 merged as well.image_sample_lwith DIM 1D passes for that thread, so both paths agree on this driver; it is the blend expectation10 + 40 * LODthat the GPU does not meet at LOD 1.25 with u past the edge under clamp-to-edge. 67.5 corresponds to a blend weight of 0.4375 instead of 0.25.a98b06534passed on an RTX 4090 with the same driver, 616.92, so the difference is between that head and the rebased combination with #5375 and #5456 that landed, or in what those two changed underneath.The other threads of the same case are not reported since
Requirestops at the first. I can run a variant that prints every thread's blend if that helps narrow it, or test a candidate commit on this box.Tested with AI assistance (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by mitul72 on 2026-10-15T04:50:48Z.
Thanks for the detailed report. The bit-for-bit comparison against
image_sample_lDIM 1D passing on the 4090 shows the 1D path itself is right: both return the same blend there. The absolute10 + 40 * LODcheck assumed AMD's linear-mip weights, which a host driver doesn't have to match. #6221 drops that check for the linear-mip cases and keeps the DIM-1D comparison and the point-sampling checks. A run of it on your box would be welcome.