wgsl: Replace use of [[attribute]] with @attribute

Bug: tint:1382
Change-Id: I58ad2c88fde1e7c96f2ae8257e6df924b94b61db
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/77660
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton
2022-01-25 16:29:04 +00:00
committed by Dawn LUCI CQ
parent facbc82d6c
commit a9ca8cb4ab
101 changed files with 1307 additions and 1312 deletions

View File

@@ -66,14 +66,14 @@ void init() {
scalar : f32;
scalarOffset : f32;
};
[[group(0), binding(0)]] var<uniform> c : Constants;
@group(0) @binding(0) var<uniform> c : Constants;
struct VertexOut {
[[location(0)]] v_color : vec4<f32>;
[[builtin(position)]] Position : vec4<f32>;
@location(0) v_color : vec4<f32>;
@builtin(position) Position : vec4<f32>;
};
[[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32) -> VertexOut {
@stage(vertex) fn main(@builtin(vertex_index) VertexIndex : u32) -> VertexOut {
var positions : array<vec4<f32>, 3> = array<vec4<f32>, 3>(
vec4<f32>( 0.0, 0.1, 0.0, 1.0),
vec4<f32>(-0.1, -0.1, 0.0, 1.0),
@@ -113,8 +113,7 @@ void init() {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModule(device, R"(
[[stage(fragment)]] fn main([[location(0)]] v_color : vec4<f32>)
-> [[location(0)]] vec4<f32> {
@stage(fragment) fn main(@location(0) v_color : vec4<f32>) -> @location(0) vec4<f32> {
return v_color;
})");