You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because Naga doesn't implement WGSL's template list discovery algorithm, full constant expressions aren't permitted everywhere they ought to be. Or at least, not without parentheses. The following is valid WGSL, but Naga rejects it, even on the const-expressions-2 branch:
$ cat expr-array-length.wgsl
var<workgroup> buffer: array<u32, 1024 * 1024>;
$ naga expr-array-length.wgsl
Finished dev [unoptimized + debuginfo] target(s) in 0.03s
Running `/home/jimb/rust/naga/target/debug/naga expr-array-length.wgsl`
error: expected '>', found '*'
┌─ expr-array-length.wgsl:1:40
│
1 │ var<workgroup> buffer: array<u32, 1024 * 1024>;
│ ^ expected '>'
Could not parse WGSL
$
If we change it as follows, Naga accepts it:
var<workgroup> buffer: array<u32, (1024 * 1024)>;
The problem here is that Naga doesn't yet implement template list discovery, so it can't tell that the > in array<u32, 1024 * 1024> is the closing bracket of a template list, rather than a > operator in an expression.
The text was updated successfully, but these errors were encountered:
Because Naga doesn't implement WGSL's template list discovery algorithm, full constant expressions aren't permitted everywhere they ought to be. Or at least, not without parentheses. The following is valid WGSL, but Naga rejects it, even on the
const-expressions-2
branch:If we change it as follows, Naga accepts it:
The problem here is that Naga doesn't yet implement template list discovery, so it can't tell that the
>
inarray<u32, 1024 * 1024>
is the closing bracket of a template list, rather than a>
operator in an expression.The text was updated successfully, but these errors were encountered: