Repository navigation
shader: lower bound-table descriptor waterfalls in pixel stages - #3823
Merged
R0Y00 merged 7 commits intoDec 2, 2026
Merged
Conversation
Accept the single-block readfirstlane waterfall when its descriptor load reads a bound root table instead of the resource heap. The proven key range selects a span of that table, which is declared as an SRV array and indexed nonuniformly. Implicit samples keep the quad gradients of the original coordinates. Refs R0Y00#3210.
Patch the sampled MRT fixture so each lane selects a slot of table 0 from its own U coordinate. Check the manifest span, the single nonuniform binding handle and the sample variant in the DXIL, and keep refusals for an unbounded key, a span past the declared range, a loop side effect, an unproven pending mask and a mismatched key. Refs R0Y00#3210.
Add a --waterfall draw to native_sampled_pixel_gpu. Guest table 0 holds three two-mip textures and the offset buffer. The test passes the translated register order from the manifest. Lanes select a slot from their pixel column: alternate slots (repeated indices in each quad), slots 0 and 2 of a three-slot span (slot 1 has no lane), and the alternate selection at implicit LOD, where mip 1 is correct only if the quad gradient includes the scissored helper column. Expected colors come from the texture contents and pixel positions. Refs R0Y00#3210.
A backward edge around an EXEC compare and an image operation is now refused with the first part of the waterfall shape that does not hold, instead of falling through to the generic loop path. The bound-table negatives assert each reason, and two more cover a backedge that skips the key read and a branch into the loop body. Refs R0Y00#3210.
Only a loop that reads a lane key with v_readfirstlane_b32, partitions EXEC, accesses an image and updates its pending lanes with s_andn2_wrexec is refused by waterfall reason. A uniform counter loop around a local CMPX region and an image translates again, as on main, and the linked-pair check covers it. Refs R0Y00#3210.
The fixture sampler leaves MIP_FILTER at zero, which the frontend refuses for implicit-LOD samples. Load word 2 with MIP_FILTER = point for the implicit cases, as the draw's static sampler uses. Refs R0Y00#3210.
The generic lowering refuses the counter fixture's CMPX region without a whole-quad parent. Enter whole-quad mode before the loop, and assert only that no waterfall reason is given: the generic path may translate the loop or refuse it for its own reason. Refs R0Y00#3210.
R0Y00
approved these changes
Dec 2, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
Independent Windows Debug result at 17884dd3: ctest --preset dev --no-tests=error -j 1 -R '^native_indexed_pixel_texture_(warp|hardware)$' --output-on-failure passed 2/2 on Windows 11 26300.9974, WARP 10.0.26100.9818 and RTX 4060 Laptop 32.0.16.1656. The three waterfall draws each matched 28 covered and four sentinel pixels per backend. The waterfall subcommand did not enable the debug layer. As a local mutation, I changed the descriptor-source guard to require the resource heap. The WARP control then failed on the expected bound-table translation at +0x88. Restored the source and rebuilt the compiler.
5 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#3091 lowers the
v_readfirstlane_b32descriptor waterfall in pixel stages only when the descriptor is loaded from the resource heap. The same loop over a bound root table is refused, so an ordinary pixel shader that selects one of a few table slots per lane does not translate. A loop that only resembles a waterfall also falls through to the generic loop path without saying which part of the shape was not proven.Change
s_andn2_wrexecis treated as a waterfall attempt. If its shape does not hold, it is refused with the first unproven part (pixel descriptor waterfall: ...).main.The heap path from #3091 is unchanged.
Known limit: an outer uniform loop that contains a complete waterfall is refused early.
mainalready refuses the inner waterfall in that case.Validation
Windows, MSVC, on 17884dd. Fixtures are source-built: the linked pair from
native_sampled_pixel_gpu --write-fixture, patched so each lane derives its slot from its own coordinate.Both tests pass, none skipped.
sampleGradwith the quad derivatives.Not covered: a waterfall nested in another loop (refused, see above) and bound-table views other than non-comparison 2D or 2D-array texture SRVs (refused).
Part of #3210. Extends #3091.