Fence each optnone call only helper invocations may make before a storage write with an identity simdgroup shuffle
What: on a driver whose compiler loses a simdgroup's texture writes after an `optnone` call that only its helper invocations make (DriverWorkaround::DiscardDropsSimdgroupStores: MoltenVK on an Apple GPU), a call the helper guard cannot keep the helpers away from exactly (an arm with a derivative or subgroup operation, a loop the helpers repeat alone) and that no tangled instruction reading its result follows was left as it was, with PrecisionNote::HelperBranchDropsSimdgroupStores recorded. Now spirv::helper_branches fences each such call: an OpGroupNonUniformShuffle of its result at SubgroupLocalInvocationId (a MulExtended's structure member by member, put together again) follows it, and every use reads the shuffled value. Each invocation, a helper too, reads its own lane, so no answer changes and no lane reads another's; the shuffle is the simdgroup operation after the call, reading what it computes, that the M4 probe found keeps the writes. The fences are placed once every analysis of the module has run (compile.rs, before the verifier): those analyses would read a shuffle as a move between lanes. - guard_for returns the Fences beside Guarded (Guarded::fences counts them); plan lists every bare call (Facts::bare, which any_bare was) and no longer stops at the first function with one. - The census names the fences `fragment.helper-fence`; the runtime's pipeline creation log prints `helper-fence <stage>`. - The note stays where no shuffle can follow: no fragment-stage subgroup shuffle on the profile, or a 64-bit or bool lane, or an 8- or 16-bit one without shaderSubgroupExtendedTypes. Why: the weather widget's glass edges in the 27.0.1 guest on the M3 draw white 8x4-pixel blocks along the primitive's edges (solid strips in some boots, a comb in others, at every pin since 30), and the guest's run announces helper-branch-drops-simdgroup-stores for a fragment function. Tests: engine_fragment's helper guard tests (rch_helper_branch_loop and rch_helper_tangle's `before` and `unread` functions fenced, census and shuffles counted, no note, L3), a new test that the note stays with the fragment shuffle taken out of the profile, and the runtime lane helper_tangle, which now requires the fence and no lost write where the fragment stage shuffles. SEMANTICS_VERSION 2021. Verified: cargo fmt; the build, the touched tests and the M3 lane follow.
This commit is contained in:
1 parent
580ef6ac56
commit
04bf17db16
9 files changed
+614
-99
No files matched your search
+4
-1
@@ -3998,7 +3998,10 @@ bound.
|
||||
edges, or demoted invocations) may run it before a storage write, and keeping them out would not
|
||||
be exact (`spirv::helper_branches`): a derivative or subgroup operation reads what they compute
|
||||
there or after, an arm leaves its selection otherwise than at its merge, or the call is in a loop
|
||||
whose helper invocations may iterate alone.
|
||||
whose helper invocations may iterate alone; and no identity shuffle of the call's result can
|
||||
follow it, which keeps the writes where the module places one: the device has no fragment-stage
|
||||
subgroup shuffle, or the result is a 64-bit or `bool` lane, or an 8- or 16-bit one without
|
||||
`shaderSubgroupExtendedTypes`.
|
||||
- `metal2vulkan-degrade-extended-range-float-blend-source` (precision).
|
||||
`PrecisionNote::ExtendedRangeFloatBlendSource`: `PrecisionNote::ExtendedRangeBlendSource` for a
|
||||
`float` color output (a scalar or vector of AIR's `float`): blended into an extended-range or
|
||||
|
||||
Reference in new issue
Block a user