fix(shader): point-filter direct samplers paired with unsigned integer images #7707
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7707"
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 milescoviello on 2026-10-19T02:00:36Z.
What
agc_driver_image_tablepasses, but the Khronos validation layer reportsVUID-vkCmdDispatch-magFilter-04553once per process on every device @Amoenus checked (#7699). A sampled image with anR32_UINTview is used with aVK_FILTER_LINEARsampler, andR32_UINThas noSAMPLED_IMAGE_FILTER_LINEARsupport.The dispatch is the test's direct-binding control
RunDirect(device, LinearWrap, uintImage), a directuintT# under a linear S#. A run with the validation layer and a marker before each of the test's dispatches puts the error right after that call, once per process on both NVIDIA and lavapipe.Direct bindings choose which samplers get a point-filtered copy in
DescriptorBindingBuilder.cpp(samplerMode). That rule covers signed integer, converted and depth views, but not unsigned integer ones. Image table entries already use the point-filtered copy for both integer classes (requiresPointSamplerinResourceMaterializer.cpp). #757 first made the direct rule cover unsigned images too, after lavapipe returned a non-point result for this pairing. The rule inmaincovers signed images only.This PR adds the unsigned integer class to
samplerMode, so a directuintbinding under a linear S# gets the point-filtered copy, as table entries and signed views do. On AMD hardware, integer formats aren't filtered either, so the point sample is what the guest sees. The test's control now expectsPointWrapfor the directuintbinding. Float bindings keepLinearWrap.Tested
Ubuntu 24.04 (Linux 6.8), GCC 13.3, Release; NVIDIA GeForce RTX 4070 Ti (595.99.02) and lavapipe. The Khronos validation layer is Ubuntu's 1.3.275 package, loaded with
VK_LAYER_PATHandVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation.main0c25997a5aunder the layer:agc_driver_image_tablepasses but reportsVUID-vkCmdDispatch-magFilter-04553once, on NVIDIA and on lavapipe, right afterRunDirect(device, LinearWrap, uintImage).magFiltererror on either device. The only report left isVUID-VkDeviceCreateInfo-pNext-pNext, which this older layer gives onmaintoo for newer device extensions.agc_driver_image_tablepasses 3 of 3. Withmain'sDescriptorBindingBuilder.cppunder the updated test, it fails withimage table: the direct bindings under a linear S# changed their sampler copies.image|sampler|^agc_driver_graphics$pass.image_sample_lzon an RX 6700 XT (gfx1031, RDNA 2) through HIP. Under a bilinear S#, a32_UINTT# returns the texel under the coordinate (floor(u)), the same as a point S#, while32_FLOATblends. That is what the point-filtered copy gives a directuintbinding. This is desktop RDNA 2, not a PS5, and covers unsigned 32-bit only.main6b8228b2b.agc_driver_image_tablepasses 3 of 3, and fails with only this PR's test changes. An Intel UHD 770 can't run it either way, becausemainrefuses its image tables before this code (#6647).main97d5d7a52awith this change, on an RTX 5080 and an AMD Radeon iGPU (Khronos 1.4.363). On unmodifiedmain, the test passes 3 of 3 with onemagFilter-04553per process. With only the test change, it fails 3 of 3 at the sampler-copy assertion. With this PR, it passes 3 of 3 with no validation errors.VK_LAYER_PATH,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -V, RTX 4070 Ti, Linux. Neither log reportswas not found but was requested by env var VK_INSTANCE_LAYERS.^agc_driver_image_table$: onmain017f2151cait reportsmagFilter-04553×3 andVkDeviceCreateInfo-pNext-pNext×3. With this PR it reports onlypNext-pNext×3, which this older layer gives for newer device extensions.main017f2151careportsmagFilter-04553×2, and this PR reports nothing.mainc4708fa20, under the 1.3.275 layer withVK_LOADER_DEBUG=layerconfirming it loaded.magFilter-04553goes from 1 to 0, the old layer's two noise VUIDs have the same counts with and without the PR, and the full suite is 1631/1633 on both, with the same two failures.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T02:13:54Z.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppcore/libs/prx/libSceAgcDriver/tests/execution/ImageTable.cppcore/shader/recompiler/Optimization/src/DescriptorBindingBuilder.cppImported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-19T07:37:43Z.
Hardware data for "on AMD hardware, integer formats aren't filtered": RX 6700 XT (gfx1031, RDNA 2), native
image_sample_lzthrough HIP on a 32x1 linear T# whose texels hold 10, 20, ..., 320, with an S# that hasXY_MAG_FILTERandXY_MIN_FILTERset to bilinear, sampled at texel coordinates 8.0 to 11.875 in steps of 1/8:floor(u)): 90 for 8.0-8.875, 100 for 9.0-9.875, ...So with a linear S#, the hardware returns the unsigned integer texel a point S# returns, the one containing the coordinate (
floor(u)), not a blend and not the top-left texel of the bilinear footprint. That is what this PR's point-filtered copy gives a directuintbinding. Desktop RDNA 2, not a PS5; I measured 32_UINT only, not the signed formats.Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-19T07:42:09Z.
RDNA 4 data:
agc_driver_image_tablefails onmainand passes with this PR on an AMD RX 9070 XT. On an Intel UHD 770 it can't run either way, for the reason #6647 fixes.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first. This head193c54016merged intomain6b8228b2b. "Without" means this PR's test files onmain6b8228b2b, with none of its other changes.agc_driver_image_tablesampler tables need runtimeDescriptorArray and descriptorBindingPartiallyBound, which the device lacksimage table: the direct bindings under a linear S# changed their sampler copiesThe UHD 770's regular descriptor limits are 200 per stage, so
mainrefuses its image tables before reaching this PR's code (#6647 binds them through the update-after-bind limits).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-19T11:26:10Z.
@milescoviello independent Windows validation on main
97d5d7a52aplus your193c540162change, composition567c7ecc39. Original author retained; this is a current-main composition, not an unchanged old-head run.The failing control changes only the expected uint sampler copy. Full default and explicit
relinker libsbuilds pass. Image-table, cache-bounds and prepared-graphics tests pass three times on each GPU, plus three CPU shader-memory tests: 21 passes, no VUID/errors/warnings, whole-test skips or timeouts. AMD's wave32-only per-wave-key subcases remain excluded on subgroup64, as on main.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, Khronos 1.4.363 confirmed loaded; verbose serial CTest, 30 s per process. Windows 11 Enterprise 26200 / GCC 15.2 r7; NVIDIA RTX 5080 (10de:2c02), driver 610.62 / 32.0.16.1062; AMD Radeon(TM) Graphics (1002:13c0), driver 32.0.21036.18. Actual selected-device output verified. Main has since advanced tof6eeca4f5f; that newer composition, Linux, title impact and performance are not tested here. #7699 updated in place.AI-assisted validation/report: yes, Codex.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T11:26:57Z.
@thuanquang @savvaniss @Amoenus thank you, all three are in the description now.
32_UINTT# under a bilinear S# returns the same texel as a point S#, so the point-filtered copy matches RDNA 2.magFilter-04553going away on two more vendors, with the test-only control failing as it should.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-19T14:20:48Z.
First AMD-on-Linux (RADV) data for this PR. Merged onto
mainc4708fa20(clean merge) and compared with the samemain, on the same machine.Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release. AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8. Khronos validation layer 1.3.275, confirmed loaded with
VK_LOADER_DEBUG=layer.ANYPS5_NO_SHADER_CACHE=1mainVUID-vkCmdDispatch-magFilter-04553(R32_UINTunder a linear sampler)agc_driver_image_tableagc_driver_image_tableThe only other
VUID-lines in these runs come from the old layer:VkDeviceCreateInfo-pNext-pNext, because it predatesVK_KHR_maintenance8, andVkGraphicsPipelineCreateInfo-pLibraries-06681. Their counts are identical with and without the PR (4 and 26). The PR adds no newVUID-.Full suite without the layer (
ANYPS5_REQUIRE_VULKAN=1 ctest -j8): 1631/1633 on bothmainand with this PR. The two failures are the same on both:agc_driver_image_table_vouched_lookups(#7766, fix in #7916) andagc_driver_guest_memory_lifetime(#7784).GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T16:05:57Z.
@DavidAmsellem thank you, that fills the RADV-on-Linux cell. The error goes away on gfx1100 too, the old layer's noise counts match on both sides, and the full suite matches
main. It's in the description now.AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-20T00:58:42Z.
Checked the diff against the description:
samplerModenow point-filters unsigned integer direct bindings like signed, converted and depth ones (matchingrequiresPointSamplerfor table entries), and the updated control expectsPointWrapfor the directuintbinding, so it fails without the change. Hardware data from @thuanquang (RDNA 2, 32_UINT under a bilinear S# equals point) and the validation runs from @savvaniss, @Amoenus and @DavidAmsellem back it; merged.