@@ -71,6 +71,7 @@ impl EnableExtension {
71
71
const CLIP_DISTANCES : & ' static str = "clip_distances" ;
72
72
const DUAL_SOURCE_BLENDING : & ' static str = "dual_source_blending" ;
73
73
const SUBGROUPS : & ' static str = "subgroups" ;
74
+ const PRIMITIVE_INDEX : & ' static str = "primitive-index" ;
74
75
75
76
/// Convert from a sentinel word in WGSL into its associated [`EnableExtension`], if possible.
76
77
pub ( crate ) fn from_ident ( word : & str , span : Span ) -> Result < ' _ , Self > {
@@ -81,6 +82,9 @@ impl EnableExtension {
81
82
Self :: Implemented ( ImplementedEnableExtension :: DualSourceBlending )
82
83
}
83
84
Self :: SUBGROUPS => Self :: Unimplemented ( UnimplementedEnableExtension :: Subgroups ) ,
85
+ Self :: PRIMITIVE_INDEX => {
86
+ Self :: Unimplemented ( UnimplementedEnableExtension :: PrimitiveIndex )
87
+ }
84
88
_ => return Err ( Box :: new ( Error :: UnknownEnableExtension ( span, word) ) ) ,
85
89
} )
86
90
}
@@ -95,6 +99,7 @@ impl EnableExtension {
95
99
} ,
96
100
Self :: Unimplemented ( kind) => match kind {
97
101
UnimplementedEnableExtension :: Subgroups => Self :: SUBGROUPS ,
102
+ UnimplementedEnableExtension :: PrimitiveIndex => Self :: PRIMITIVE_INDEX ,
98
103
} ,
99
104
}
100
105
}
@@ -132,12 +137,19 @@ pub enum UnimplementedEnableExtension {
132
137
///
133
138
/// [`enable subgroups;`]: https://www.w3.org/TR/WGSL/#extension-subgroups
134
139
Subgroups ,
140
+ /// Enables the `@builtin(primitive_index)` attribute in WGSL.
141
+ ///
142
+ /// In the WGSL standard, this corresponds to [`enable primitive-index;`].
143
+ ///
144
+ /// [`enable primitive-index;`]: https://www.w3.org/TR/WGSL/#extension-primitive_index
145
+ PrimitiveIndex ,
135
146
}
136
147
137
148
impl UnimplementedEnableExtension {
138
149
pub ( crate ) const fn tracking_issue_num ( self ) -> u16 {
139
150
match self {
140
151
Self :: Subgroups => 5555 ,
152
+ Self :: PrimitiveIndex => 8236 ,
141
153
}
142
154
}
143
155
}
0 commit comments