Skip to content

Commit d696f8b

Browse files
Deploying to master from @ gfx-rs/wgpu@d539466 🚀
1 parent fef9fa3 commit d696f8b

File tree

8 files changed

+529
-41
lines changed

8 files changed

+529
-41
lines changed

doc/naga/front/wgsl/struct.ParseError.html

Lines changed: 6 additions & 6 deletions
Large diffs are not rendered by default.

doc/src-files.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/src/naga/front/wgsl/error.rs.html

Lines changed: 155 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -908,7 +908,87 @@
908908
<a href="#907" id="907">907</a>
909909
<a href="#908" id="908">908</a>
910910
<a href="#909" id="909">909</a>
911-
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::directive::{DirectiveKind, UnimplementedDirectiveKind};
911+
<a href="#910" id="910">910</a>
912+
<a href="#911" id="911">911</a>
913+
<a href="#912" id="912">912</a>
914+
<a href="#913" id="913">913</a>
915+
<a href="#914" id="914">914</a>
916+
<a href="#915" id="915">915</a>
917+
<a href="#916" id="916">916</a>
918+
<a href="#917" id="917">917</a>
919+
<a href="#918" id="918">918</a>
920+
<a href="#919" id="919">919</a>
921+
<a href="#920" id="920">920</a>
922+
<a href="#921" id="921">921</a>
923+
<a href="#922" id="922">922</a>
924+
<a href="#923" id="923">923</a>
925+
<a href="#924" id="924">924</a>
926+
<a href="#925" id="925">925</a>
927+
<a href="#926" id="926">926</a>
928+
<a href="#927" id="927">927</a>
929+
<a href="#928" id="928">928</a>
930+
<a href="#929" id="929">929</a>
931+
<a href="#930" id="930">930</a>
932+
<a href="#931" id="931">931</a>
933+
<a href="#932" id="932">932</a>
934+
<a href="#933" id="933">933</a>
935+
<a href="#934" id="934">934</a>
936+
<a href="#935" id="935">935</a>
937+
<a href="#936" id="936">936</a>
938+
<a href="#937" id="937">937</a>
939+
<a href="#938" id="938">938</a>
940+
<a href="#939" id="939">939</a>
941+
<a href="#940" id="940">940</a>
942+
<a href="#941" id="941">941</a>
943+
<a href="#942" id="942">942</a>
944+
<a href="#943" id="943">943</a>
945+
<a href="#944" id="944">944</a>
946+
<a href="#945" id="945">945</a>
947+
<a href="#946" id="946">946</a>
948+
<a href="#947" id="947">947</a>
949+
<a href="#948" id="948">948</a>
950+
<a href="#949" id="949">949</a>
951+
<a href="#950" id="950">950</a>
952+
<a href="#951" id="951">951</a>
953+
<a href="#952" id="952">952</a>
954+
<a href="#953" id="953">953</a>
955+
<a href="#954" id="954">954</a>
956+
<a href="#955" id="955">955</a>
957+
<a href="#956" id="956">956</a>
958+
<a href="#957" id="957">957</a>
959+
<a href="#958" id="958">958</a>
960+
<a href="#959" id="959">959</a>
961+
<a href="#960" id="960">960</a>
962+
<a href="#961" id="961">961</a>
963+
<a href="#962" id="962">962</a>
964+
<a href="#963" id="963">963</a>
965+
<a href="#964" id="964">964</a>
966+
<a href="#965" id="965">965</a>
967+
<a href="#966" id="966">966</a>
968+
<a href="#967" id="967">967</a>
969+
<a href="#968" id="968">968</a>
970+
<a href="#969" id="969">969</a>
971+
<a href="#970" id="970">970</a>
972+
<a href="#971" id="971">971</a>
973+
<a href="#972" id="972">972</a>
974+
<a href="#973" id="973">973</a>
975+
<a href="#974" id="974">974</a>
976+
<a href="#975" id="975">975</a>
977+
<a href="#976" id="976">976</a>
978+
<a href="#977" id="977">977</a>
979+
<a href="#978" id="978">978</a>
980+
<a href="#979" id="979">979</a>
981+
<a href="#980" id="980">980</a>
982+
<a href="#981" id="981">981</a>
983+
<a href="#982" id="982">982</a>
984+
<a href="#983" id="983">983</a>
985+
<a href="#984" id="984">984</a>
986+
<a href="#985" id="985">985</a>
987+
<a href="#986" id="986">986</a>
988+
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::directive::enable_extension::{
989+
EnableExtension, UnimplementedEnableExtension,
990+
};
991+
<span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::directive::{DirectiveKind, UnimplementedDirectiveKind};
912992
<span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::lexer::Token;
913993
<span class="kw">use </span><span class="kw">crate</span>::front::wgsl::Scalar;
914994
<span class="kw">use </span><span class="kw">crate</span>::proc::{Alignment, ConstantEvaluatorError, ResolveError};
@@ -1022,6 +1102,8 @@
10221102
</span><span class="kw">pub enum </span>ExpectedToken&lt;<span class="lifetime">'a</span>&gt; {
10231103
Token(Token&lt;<span class="lifetime">'a</span>&gt;),
10241104
Identifier,
1105+
AfterIdentListComma,
1106+
AfterIdentListArg,
10251107
<span class="doccomment">/// Expected: constant, parenthesized expression, identifier
10261108
</span>PrimaryExpression,
10271109
<span class="doccomment">/// Expected: assignment, increment/decrement expression
@@ -1094,6 +1176,7 @@
10941176
UnknownType(Span),
10951177
UnknownStorageFormat(Span),
10961178
UnknownConservativeDepth(Span),
1179+
UnknownEnableExtension(Span, <span class="kw-2">&amp;</span><span class="lifetime">'a </span>str),
10971180
SizeAttributeTooLow(Span, u32),
10981181
AlignAttributeTooLow(Span, Alignment),
10991182
NonPowerOfTwoAlignAttribute(Span),
@@ -1183,6 +1266,14 @@
11831266
DirectiveAfterFirstGlobalDecl {
11841267
directive_span: Span,
11851268
},
1269+
EnableExtensionNotYetImplemented {
1270+
kind: UnimplementedEnableExtension,
1271+
span: Span,
1272+
},
1273+
EnableExtensionNotEnabled {
1274+
kind: EnableExtension,
1275+
span: Span,
1276+
},
11861277
}
11871278

11881279
<span class="attr">#[derive(Clone, Debug)]
@@ -1255,6 +1346,12 @@
12551346
ExpectedToken::Type =&gt; <span class="string">"type"</span>.to_string(),
12561347
ExpectedToken::Variable =&gt; <span class="string">"variable access"</span>.to_string(),
12571348
ExpectedToken::Function =&gt; <span class="string">"function name"</span>.to_string(),
1349+
ExpectedToken::AfterIdentListArg =&gt; {
1350+
<span class="string">"next argument, trailing comma, or end of list (',' or ';')"</span>.to_string()
1351+
}
1352+
ExpectedToken::AfterIdentListComma =&gt; {
1353+
<span class="string">"next argument or end of list (';')"</span>.to_string()
1354+
}
12581355
};
12591356
ParseError {
12601357
message: <span class="macro">format!</span>(
@@ -1427,6 +1524,14 @@
14271524
labels: <span class="macro">vec!</span>[(bad_span, <span class="string">"unknown type"</span>.into())],
14281525
notes: <span class="macro">vec!</span>[],
14291526
},
1527+
Error::UnknownEnableExtension(span, word) =&gt; ParseError {
1528+
message: <span class="macro">format!</span>(<span class="string">"unknown enable-extension `{}`"</span>, word),
1529+
labels: <span class="macro">vec!</span>[(span, <span class="string">""</span>.into())],
1530+
notes: <span class="macro">vec!</span>[
1531+
<span class="string">"See available extensions at &lt;https://www.w3.org/TR/WGSL/#enable-extension&gt;."
1532+
</span>.into(),
1533+
],
1534+
},
14301535
Error::SizeAttributeTooLow(bad_span, min_size) =&gt; ParseError {
14311536
message: <span class="macro">format!</span>(<span class="string">"struct member size must be at least {min_size}"</span>),
14321537
labels: <span class="macro">vec!</span>[(bad_span, <span class="macro">format!</span>(<span class="string">"must be at least {min_size}"</span>).into())],
@@ -1809,6 +1914,55 @@
18091914
</span>)
18101915
.into()],
18111916
},
1917+
Error::EnableExtensionNotYetImplemented { kind, span } =&gt; ParseError {
1918+
message: <span class="macro">format!</span>(
1919+
<span class="string">"the `{}` extension is not yet supported"</span>,
1920+
EnableExtension::Unimplemented(kind).to_ident()
1921+
),
1922+
labels: <span class="macro">vec!</span>[(
1923+
span,
1924+
<span class="macro">concat!</span>(
1925+
<span class="string">"this extension specifies standard functionality "</span>,
1926+
<span class="string">"which is not yet implemented in Naga"
1927+
</span>)
1928+
.into(),
1929+
)],
1930+
notes: <span class="macro">vec!</span>[<span class="macro">format!</span>(
1931+
<span class="macro">concat!</span>(
1932+
<span class="string">"Let Naga maintainers know that you ran into this at "</span>,
1933+
<span class="string">"&lt;https://github.com/gfx-rs/wgpu/issues/{}&gt;, "</span>,
1934+
<span class="string">"so they can prioritize it!"
1935+
</span>),
1936+
kind.tracking_issue_num()
1937+
)],
1938+
},
1939+
Error::EnableExtensionNotEnabled { kind, span } =&gt; ParseError {
1940+
message: <span class="macro">format!</span>(<span class="string">"`{}` enable extension is not enabled"</span>, kind.to_ident()),
1941+
labels: <span class="macro">vec!</span>[(
1942+
span,
1943+
<span class="macro">format!</span>(
1944+
<span class="macro">concat!</span>(
1945+
<span class="string">"the `{}` enable extension is needed for this functionality, "</span>,
1946+
<span class="string">"but it is not currently enabled"
1947+
</span>),
1948+
kind.to_ident()
1949+
)
1950+
.into(),
1951+
)],
1952+
notes: <span class="kw">if let </span>EnableExtension::Unimplemented(kind) = kind {
1953+
<span class="macro">vec!</span>[<span class="macro">format!</span>(
1954+
<span class="macro">concat!</span>(
1955+
<span class="string">"This extension is not yet implemented. "</span>,
1956+
<span class="string">"Let Naga maintainers know that you ran into this at "</span>,
1957+
<span class="string">"&lt;https://github.com/gfx-rs/wgpu/issues/{}&gt;, "</span>,
1958+
<span class="string">"so they can prioritize it!"
1959+
</span>),
1960+
kind.tracking_issue_num()
1961+
)]
1962+
} <span class="kw">else </span>{
1963+
<span class="macro">vec!</span>[]
1964+
},
1965+
},
18121966
}
18131967
}
18141968
}

doc/src/naga/front/wgsl/parse/ast.rs.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,13 +487,17 @@
487487
<a href="#486" id="486">486</a>
488488
<a href="#487" id="487">487</a>
489489
<a href="#488" id="488">488</a>
490-
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::number::Number;
490+
<a href="#489" id="489">489</a>
491+
<a href="#490" id="490">490</a>
492+
</pre></div><pre class="rust"><code><span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::directive::enable_extension::EnableExtensions;
493+
<span class="kw">use </span><span class="kw">crate</span>::front::wgsl::parse::number::Number;
491494
<span class="kw">use </span><span class="kw">crate</span>::front::wgsl::Scalar;
492495
<span class="kw">use crate</span>::{Arena, FastIndexSet, Handle, Span};
493496
<span class="kw">use </span>std::hash::Hash;
494497

495498
<span class="attr">#[derive(Debug, Default)]
496499
</span><span class="kw">pub struct </span>TranslationUnit&lt;<span class="lifetime">'a</span>&gt; {
500+
<span class="kw">pub </span>enable_extensions: EnableExtensions,
497501
<span class="kw">pub </span>decls: Arena&lt;GlobalDecl&lt;<span class="lifetime">'a</span>&gt;&gt;,
498502
<span class="doccomment">/// The common expressions arena for the entire translation unit.
499503
///

0 commit comments

Comments
 (0)