Skip to content

Commit 1b51f0a

Browse files
ErichDonGublerjimblandy
authored andcommitted
feat(naga): add UnimplementedEnableExtension::Subgroups
1 parent b7711e5 commit 1b51f0a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

naga/src/front/wgsl/parse/directive/enable_extension.rs

+10
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ impl EnableExtension {
6666
const F16: &'static str = "f16";
6767
const CLIP_DISTANCES: &'static str = "clip_distances";
6868
const DUAL_SOURCE_BLENDING: &'static str = "dual_source_blending";
69+
const SUBGROUPS: &'static str = "subgroups";
6970

7071
/// Convert from a sentinel word in WGSL into its associated [`EnableExtension`], if possible.
7172
pub(crate) fn from_ident(word: &str, span: Span) -> Result<Self> {
@@ -77,6 +78,7 @@ impl EnableExtension {
7778
Self::DUAL_SOURCE_BLENDING => {
7879
Self::Implemented(ImplementedEnableExtension::DualSourceBlending)
7980
}
81+
Self::SUBGROUPS => Self::Unimplemented(UnimplementedEnableExtension::Subgroups),
8082
_ => return Err(Box::new(Error::UnknownEnableExtension(span, word))),
8183
})
8284
}
@@ -90,6 +92,7 @@ impl EnableExtension {
9092
},
9193
Self::Unimplemented(kind) => match kind {
9294
UnimplementedEnableExtension::ClipDistances => Self::CLIP_DISTANCES,
95+
UnimplementedEnableExtension::Subgroups => Self::SUBGROUPS,
9396
},
9497
}
9598
}
@@ -121,12 +124,19 @@ pub enum UnimplementedEnableExtension {
121124
///
122125
/// [`enable clip_distances;`]: https://www.w3.org/TR/WGSL/#extension-clip_distances
123126
ClipDistances,
127+
/// Enables subgroup built-ins in all languages.
128+
///
129+
/// In the WGSL standard, this corresponds to [`enable subgroups;`].
130+
///
131+
/// [`enable subgroups;`]: https://www.w3.org/TR/WGSL/#extension-subgroups
132+
Subgroups,
124133
}
125134

126135
impl UnimplementedEnableExtension {
127136
pub(crate) const fn tracking_issue_num(self) -> u16 {
128137
match self {
129138
Self::ClipDistances => 6236,
139+
Self::Subgroups => 5555,
130140
}
131141
}
132142
}

0 commit comments

Comments
 (0)