shader: a gather's level is whole where only the lanes that gather wrote it (half of the black G-buffer, #182) #245
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/245"
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 LakshanSivakumar/Native-Victory-macOS. Originally posted by Olima34 on 2026-11-27T04:07:26Z.
This finds where the black G-buffer comes from (#182), and fixes half of the cause.
The chain, traced in game:
DispatchMeshrecords. In every record traced (600), the group count read[0, 1, 1].e85d0ba6. Six culling compute shaders then fill them, in three pairs over the same buffers.VICTORY_DEBUG_NO_DEPTH.This PR (the first member of each pair).
b30937e9de066fa9,5833c0c20c5bec9bandff826810673a0198were refused with "a gather at a level that may not be whole".ceil(log2(...)) - 1, clamped at 0, then av_cmpx_le_i32and av_mov_b32of another whole level.whole()also asked that the value each write keeps in the lanes that skip it be whole. Here that value is an unrelated product, kept only in lanes that never reach the gathers.whole()now takes the gather's site. It looks at a guarded write's kept value only when a lane that runs the gather may have skipped the write (avoids(site, Skip)).Still refused (the second member of each pair).
4e2edbd69fe414f1,f44473ebe75e0047and898d9c1a5605ad81are refused with "a cross-lane operation between host waves in divergent code".s_mov exec, 1andreadlane 63, thends_orto LDS[0] and a barrier.Evidence:
emit::sample_tests::gathers_at_a_level_whole_in_the_lanes_that_gather_translatefails without the fix. It also checks that the gather stays refused when every lane gathers.wave32_hostandzero_copy_memoryas on the native host). The six refused this way translate, and no other outcome changes.ran (indirect)), and the first non-zero mesh group counts appear:[1,1,1],[5,1,1],[16,1,1],[24,1,1].Checks: victory-shader 310 tests pass. victory-hle, victory, victory-gpu (arm64) and xtask pass. Windows clippy is clean with
-D warnings.cargo xtask policypasses.docs/native-host.mdhas the whole chain under "The G-buffer's mesh draws dispatch no groups".Imported from LakshanSivakumar/Native-Victory-macOS. Originally posted by LakshanSivakumar on 2026-11-27T04:26:28Z.
Review: APPROVED
Reviewed and tested together with the other open PRs on main (macOS x86_64 workspace tests, the setup shell tests, and Windows clippy). Thanks!