From e97d5da60cb1ddf9cd6686385a7ed13c8d428321 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 18:13:09 -0800 Subject: [PATCH] Docs: HelperBranchDropsSimdgroupStores also covers a call in no branch that SPIRV-Cross writes in one The catalogue entry and the variant's rustdoc name the new case: a ?: arm, the right side of a && or ||, or a selection's arm, where the call's value is read once (spirv::helper_branches). --- crates/metal2vulkan/src/pipeline/artifact.rs | 6 ++++-- docs/API.md | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/metal2vulkan/src/pipeline/artifact.rs b/crates/metal2vulkan/src/pipeline/artifact.rs index 48b93b2a3..60a18deea 100644 --- a/crates/metal2vulkan/src/pipeline/artifact.rs +++ b/crates/metal2vulkan/src/pipeline/artifact.rs @@ -1541,8 +1541,10 @@ pub enum PrecisionNote { /// primitive's edges, or demoted invocations) may run it before a storage write (not in a /// selection on a value every invocation of a draw computes alike), 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. Only where a path from the call + /// compute there or after, an arm leaves its selection otherwise than at its merge, the call is + /// in a loop whose helper invocations may iterate alone, or it is in no branch at all but + /// SPIRV-Cross writes it in one (a `?:` arm, the right side of a `&&` or `||`, or a + /// selection's arm, where its value is read once). Only where a path from the call /// ends without a tangled instruction (an implicit-LOD sample, an LOD query, a derivative, a /// subgroup operation) that reads what it computes: one after it keeps the writes. And only /// where no identity shuffle of the call's result can follow it, which the module places diff --git a/docs/API.md b/docs/API.md index 31af35048..dd890098a 100644 --- a/docs/API.md +++ b/docs/API.md @@ -4271,8 +4271,10 @@ bound. `NoContraction`, among others) where only helper invocations (the quad helpers past a primitive's 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; and no identity shuffle of the call's result can + there or after, an arm leaves its selection otherwise than at its merge, the call is in a loop + whose helper invocations may iterate alone, or it is in no branch at all but SPIRV-Cross writes + it in one (a `?:` arm, the right side of a `&&` or `||`, or a selection's arm, where its value + is read once); 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`.