Shaders: in the console flow, a lane-mask join takes no lane from an edge that brings a descriptor's address or format (on #439) #3830
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3830"
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 Marvisak/VIctory. Originally posted by redNSF on 2026-11-29T12:08:39Z.
Stacked on #439 (the console flow in halves); the last commit is this change. It needs nothing from #3683 and merges with it without conflicts.
Problem. Ten
rtdirectionalshadows:CS_RTShadowTrace32HQ*programs (wave32, 32 threads) read a named lane under the lanes' own branches, so they take the console flow on every host. There they stop with "a descriptor's address or format read as data". Nothing in them reads a descriptor's address: the console compiler reuses a register. InCS_RTShadowTrace32HQ:The join at 0x15144 is a lane-mask join, and so are the joins before it that pass the old s16 along; the one at 0x11294 takes the descriptor's first dword. In the console flow a lane-mask join takes a number along an edge as the lane's own bit of it (
Structured::other), and that dword has no host value (descriptor_dataleaves addresses and formats missing), so the program was refused.Change. In
fill_phis, in the console flow, an edge of a lane-mask join whose value is such a missing descriptor dword gives the join no lane. This is an assumption, markedshortcut:in the code: a descriptor's address or format bits are not a lane mask the title's code reads; a register holds them at a mask join only because the compiler reused it. A program that really tested lanes against those bits would now see no lane along that edge. (#1597 makes the same assumption for joins of descriptor dwords with data in the per-lane form; this is not that change and does not need it.) The per-lane form is untouched, and so is every program that translated before: the edge was refused until now.Effect. Grand Theft Auto VI,
translate --list, compared program by program: compute programs that translate go from 2,593 (#439) to 2,603 of 2,682 with--host-lanes 32-32, and from 2,658 to 2,668 with default lanes. The same ten are gained in both and none are lost:CS_RTShadowTrace32HQ,TemporalHQandTemporalHQ_OneOver2RPPwith theirFarOnlyforms, andHQandTemporalHQin_Tiledand_TiledFarOnly. Three programs of the family stay refused for other reasons ("a lane mask read as data" twice, "a constant buffer's descriptor read as data" once).With
--validateon #439 alone the ten are emitted but not validated: the SDK validator here rejects them for the implicit-levelsamplein compute ("Entry function performs some operation that is incompatible with the shader stage"), as it does 735 other compute programs on #439, the family's 1/4-rate forms among them. Merged with #2999 and #3735 (which make those samples explicit) all ten validate, as do all 2,615 compute programs that translate there.Tests (RTX 3060, 32-lane waves only):
a_compare_mask_joined_with_a_descriptor_dword_in_the_console_flow(waterfall_tests): a wave32 program with the title's shape. A buffer's descriptor is loaded into s[8:11] and used; unders_and_saveexecands_cbranch_execzav_cmp_ne_u32writes s8; av_cndmask_b32reads s8 under the same guard later; av_readlane_b32asks for the console flow. Refused before with the title's reason; exact on the card, all 32 lanes (the lanes under the guard take the compare's value, the others keep theirs). Skipped on adapters without 32-lane waves (WARP).cargo test -p victory-shader --libon WARP: the same 4synthetic_testsfail here as on #439 alone.Not run in the title: this PR claims that the ten programs translate, and that the join behaves as the test checks on this card.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.