xshader: lower ProjectScarlett's sun and lamp shadow walks to ray queries #306
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/306"
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 brcly/TuxBox. Originally posted by Jerkin42 on 2026-11-27T11:37:21Z.
Summary
Follows #302: two more ProjectScarlett trace programs get their inlined console BVH walks replaced with native ray queries.
tbScarlettOccluded, as in #302.tbScarlettNearestquery that returns the hit distance. Its walk uses a shared-memory stack and spills to lanes of v5. Upstream refused it ("mixed lane Wave32 cannot lower ds_write2_b32"). The Scarlett walks are now replaced before lane analysis, so that code goes with the walk. The root word the program tests for an empty scene becomes a constant; the native query handles an empty scene itself.Both are recorded without a root signature. The runtime translates them against the reflected root it builds from their user data, so the GPU replays declare that layout:
Translated against the pipeline's own title root, the scene slot names a plain SRV (t240 or t346), so both stay refused there.
One known difference in the sun walk: the console walk's hit value is a word from the hit instance's record, and the program only tests it for nonzero. A hit on an instance whose word is 0 therefore counts as a miss there. The native query reports every triangle hit. That only matters if the title uses a zero word to mark instances that cast no shadow; I have not confirmed that it does.
Verified on Lanes
python tuxbox.py checkpassed on this branch. Not run: it opens windows on this desktop. The targeted replay below was run instead.tools/check_scarlett_rays.pynow replays all four programs.GPU, driver and backend: AMD Radeon RX 9060 XT (1002:7590), RADV Mesa 26.1.8, Proton Experimental. NVIDIA still needs to run it.
tools/check_scarlett_rays.py(programs from a recorded ProjectScarlett run):Checks
cargo testfor the shader compiler: 425 + 2 passed.🤖 Generated with Claude Code