I have been learning wgpu over the past few days and I have one point of confusion. When I browse athe wgpu examples (https://github.com/gfx-rs/wgpu/tree/master/wgpu/examples) they use this syntax for their shaders:
struct VertexOutput {
@location(0) color: vec4<f32>,
@builtin(position) position: vec4<f32>,
}
but I have to write my shaders like this:
struct VertexOutput {
[[location(0)]] color: vec4<f32>;
[[builtin(position)]] position: vec4<f32>;
};
I much prefer the @
syntax to the [[]]
syntax. My guess is that it is a feature I need to enable in my Cargo.toml but I have not been able to find out what feature this is. So if someone could tell me how to use the @
syntax in my wgsl shaders it would be much appreciated.