mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-21 10:49:14 +00:00
wgsl: Replace [[decoration]] with @decoration
Deprecate the old syntax. Migrate everything to the new syntax. Bug: tint:1382 Change-Id: Ide12b2e927b17dc93b9714c7049090864cc568d3 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/77260 Reviewed-by: James Price <jrprice@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: David Neto <dneto@google.com> Commit-Queue: David Neto <dneto@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
8f1d5224ee
commit
01e4b6fc18
@@ -2,14 +2,14 @@ struct block0 {
|
||||
data : vec4<f32>;
|
||||
};
|
||||
|
||||
[[group(0), binding(1)]] var<storage, read_write> x_4 : block0;
|
||||
@group(0) @binding(1) var<storage, read_write> x_4 : block0;
|
||||
|
||||
fn main_1() {
|
||||
x_4.data = vec4<f32>(1.0, 2.0, 3.0, 4.0);
|
||||
return;
|
||||
}
|
||||
|
||||
[[stage(compute), workgroup_size(1, 1, 1)]]
|
||||
@stage(compute) @workgroup_size(1, 1, 1)
|
||||
fn main() {
|
||||
main_1();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ var<private> position : vec4<f32>;
|
||||
|
||||
var<private> frag_color : vec4<f32>;
|
||||
|
||||
[[group(0), binding(1)]] var<uniform> x_8 : block0;
|
||||
@group(0) @binding(1) var<uniform> x_8 : block0;
|
||||
|
||||
var<private> gl_Position : vec4<f32>;
|
||||
|
||||
@@ -19,14 +19,14 @@ fn main_1() {
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[builtin(position)]]
|
||||
@builtin(position)
|
||||
gl_Position : vec4<f32>;
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
frag_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(vertex)]]
|
||||
fn main([[location(0)]] position_param : vec4<f32>) -> main_out {
|
||||
@stage(vertex)
|
||||
fn main(@location(0) position_param : vec4<f32>) -> main_out {
|
||||
position = position_param;
|
||||
main_1();
|
||||
return main_out(gl_Position, frag_color);
|
||||
|
||||
@@ -9,12 +9,12 @@ fn main_1() {
|
||||
}
|
||||
|
||||
struct main_out {
|
||||
[[location(0)]]
|
||||
@location(0)
|
||||
final_color_1 : vec4<f32>;
|
||||
};
|
||||
|
||||
[[stage(fragment)]]
|
||||
fn main([[location(0)]] frag_color_param : vec4<f32>) -> main_out {
|
||||
@stage(fragment)
|
||||
fn main(@location(0) frag_color_param : vec4<f32>) -> main_out {
|
||||
frag_color = frag_color_param;
|
||||
main_1();
|
||||
return main_out(final_color);
|
||||
|
||||
Reference in New Issue
Block a user