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

@@ -314,8 +314,8 @@ int main(int argc, const char* argv[]) {
// The hacky pipeline to render a triangle.
utils::ComboRenderPipelineDescriptor pipelineDesc;
pipelineDesc.vertex.module = utils::CreateShaderModule(device, R"(
[[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32)
-> [[builtin(position)]] vec4<f32> {
@stage(vertex) fn main(@builtin(vertex_index) VertexIndex : u32)
-> @builtin(position) vec4<f32> {
var pos = array<vec2<f32>, 3>(
vec2<f32>( 0.0, 0.5),
vec2<f32>(-0.5, -0.5),
@@ -324,7 +324,7 @@ int main(int argc, const char* argv[]) {
return vec4<f32>(pos[VertexIndex], 0.0, 1.0);
})");
pipelineDesc.cFragment.module = utils::CreateShaderModule(device, R"(
[[stage(fragment)]] fn main() -> [[location(0)]] vec4<f32> {
@stage(fragment) fn main() -> @location(0) vec4<f32> {
return vec4<f32>(1.0, 0.0, 0.0, 1.0);
})");
// BGRA shouldn't be hardcoded. Consider having a map[format -> pipeline].