Replies: 2 comments
-
|
Beta Was this translation helpful? Give feedback.
-
You actually can! Example:
I'd love that as well, but WGSL has way less support for expressions than Rust, and at this point the
They don't have to write comma after the last parameter. It's just consistent with Rust to do so (e.g. clippy may yell at you).
Was mentioned in gpuweb/gpuweb#1466 and even supported, but didn't go further (separate issue is needed). |
Beta Was this translation helpful? Give feedback.
-
Why am I asking about it? Let's look at this example of code:
This is an example of code from WGPU Learn. So, what do we see? What's wrong mate?
I will do a list of what I saw verbosity:
[[location(0)]]
, why can't we just write[location(0)]? And specify a few attributes with a comma? Also the same with everything that has
[[<...>]]`.vec4<f32>(in.color, 1.0)
instead ofreturn vec4<f32>(in.color, 1.0);
.;
after}
.}
tells that this is the end of defining a struct.So, this is my opinion, but this issue is directed to the more clear and less verbose syntax of WGSL that I so much like.
Beta Was this translation helpful? Give feedback.
All reactions