shader: verify derivative-selected gather across a mip view #3065
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3065"
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 R0Y00/Xbox2Windows. Originally posted by RonLogic on 2026-11-27T13:28:33Z.
Change
Refs #1802. Add the requested differential on an 8×8 texture with a two-level SRV starting at resource mip 1. A synthetic pixel stage routes the existing
image_get_lodresult intoimage_gather4_l. With UV fixed at(9/16, 9/16)at the readback pixel, UV steps1/4and1/2select view-relative mips 0 and 1.Each draw checks four distinct taps against the CPU texel pattern and a separate
image_gather4_lzdraw on a single-level view of the expected resource mip. Binding the full two-level view to that same fixed-mip gather is the negative control. It disagrees at all four taps when the second visible mip is expected.Verification
Tested
d8f569a8e1b27167f39483db274bf1e42cf41d6bbased ondb28a796; trial-merged cleanly withff04a75e. Windows 11 build 26300.10075, MSVC 19.52, Windows SDK 10.0.26100 and DXC 1.9.2602.17.10.0.26100.10068and RTX 407032.0.16.2124matched[146,147,139,138]/512for resource mip 1 and[265,266,258,257]/512for mip 2. The D3D12 debug layer reported zero errors and warnings.git diff --checkpassed.Evidence and follow-up
The fixture uses synthetic guest words and the existing D3D12 mip-view renderer. This demonstrates a desktop equivalent for the two exact, integer-mip cases. Guest
image_gather4still requires independent RDNA evidence for its mip choice and remains refused. Fractional thresholds are outside the fixture.Checklist
I used Codex to prepare the change and ran verification locally.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-27T15:07:19Z.
Review: APPROVED
Independent review at
d8f569a8withmainca659396(treebce7c5fae7a9c30f64ad1a657bd45a3ffd2ab73e). The test-only changes keep the two visible mips distinct and compare the selected level to both the CPU tap order and a one-level SRV. The first-visible negative control differs in all four taps when resource mip 2 is required.Built
offscreen_check, then ranctest --test-dir <build> --no-tests=error -j 1 -V -R '^startup_(gather_implicit_mip_(warp|hardware)|image_get_lod_(view|array_view)_(warp|hardware)|image_gather_lz(_(warp|hardware))?|compute_gather_l_(warp|hardware))$'. Debug and Release/O2each passed 9/9 with zero skips. Both adapters matched[146,147,139,138]/512and[265,266,258,257]/512in the two cases. Windows 11 26200.9974, WARP 10.0.26100.9818, RTX 4060 Laptop driver 32.0.16.1656, SDK 10.0.26100, D3D12 debug layer enabled. #1802 still tracks guest RDNA mip selection.