AGC: agc_driver_quad_pixel_mask samples the wrong mip level under a partial quad mask on Windows (RTX 5060 Ti and Radeon 860M) #14237
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 LeandroLP23 on 2026-11-01T02:36:43Z.
agc_driver_quad_pixel_maskfails on Windows on both GPUs I have, in the implicit-LOD case under a partial quad pixel mask. The constant-color cases and mask0xfpass. The sampled pixel gets the wrong mip level, so the derivatives that go through the demoted helper pixels come out wrong, and the error differs by vendor.The test samples a 256x128 texture at
(x/64, y/32)on a 64x32 target. One pixel step is 4 texels, so level 2 (red 96) is expected.main029463ceb6pixel (1, 0) channel 0 is 32, expected 96(level 0: zero derivative)0e9dc7bc4cpixel (1, 0) channel 0 is 128, expected 96(level 3: derivative twice too large)It happens on every run (3 of 3 on the RTX 5060 Ti), with and without
VK_LAYER_KHRONOS_validation. The layer reports noVUID-errors.Both GPUs report
shaderDemoteToHelperInvocation, so the test takes the demote path.On the Radeon 860M the test fails at
90b20afac8too, the commit that switched quad-mask pixels from kill to demote, but there the helpers write their color (pixel (0, 0) channel 2 is 2, expected 0), which79d72b6836later fixed. So I can't point to a commit where it passed on this GPU. #6015 reported it passing on an RTX 4090 with the Linux driver 610.57.04.On NVIDIA it follows the 621 drivers on Blackwell: an RTX 5080 passes on 617.42 and fails on 621.14 (adam25136), and an Ada RTX 4060 Laptop passes on 621.14 (joafern22). #14341 passes on the RTX 5080 with both drivers.
Mask 2 leaves one live pixel per quad, so all of its derivatives come from helper lanes. One explanation that fits both results: the coordinate math before
image_sample(v_mul_f32afters_wqm_b64) doesn't run in the helper lanes, either because their EXEC bit is cleared or because they don't take part in the subgroup operation that rebuilds the whole-quad mask. Then the helper lanes keep a stale value, and what that value is depends on the driver. I haven't confirmed this in the SPIR-V. Is the derivative supposed to see helper lanes as live for WQM here?Command:
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_quad_pixel_mask$" --output-on-failureAI-assisted: yes (Claude Code)