mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-16 00:17:03 +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
@@ -287,13 +287,12 @@ TEST(ReplaceIdentifierTest, NotApplicable5) {
|
||||
// Can't replace `a` with `b` since the latter has a wrong access mode
|
||||
// (`read` for uniform storage class).
|
||||
std::string shader = R"(
|
||||
[[block]]
|
||||
struct S {
|
||||
a: i32;
|
||||
};
|
||||
|
||||
var<private> a: S;
|
||||
[[group(1), binding(1)]] var<uniform> b: S;
|
||||
@group(1) @binding(1) var<uniform> b: S;
|
||||
fn f() {
|
||||
*&a = S(4);
|
||||
}
|
||||
@@ -323,13 +322,12 @@ fn f() {
|
||||
TEST(ReplaceIdentifierTest, NotApplicable6) {
|
||||
// Can't replace `ptr_b` with `a` since the latter is not a pointer.
|
||||
std::string shader = R"(
|
||||
[[block]]
|
||||
struct S {
|
||||
a: i32;
|
||||
};
|
||||
|
||||
var<private> a: S;
|
||||
[[group(1), binding(1)]] var<uniform> b: S;
|
||||
@group(1) @binding(1) var<uniform> b: S;
|
||||
fn f() {
|
||||
let ptr_b = &b;
|
||||
*&a = *ptr_b;
|
||||
@@ -360,14 +358,13 @@ TEST(ReplaceIdentifierTest, NotApplicable8) {
|
||||
// Can't replace `ptr_b` with `c` since the latter has a wrong access mode and
|
||||
// storage class.
|
||||
std::string shader = R"(
|
||||
[[block]]
|
||||
struct S {
|
||||
a: i32;
|
||||
};
|
||||
|
||||
var<private> a: S;
|
||||
[[group(1), binding(1)]] var<uniform> b: S;
|
||||
[[group(1), binding(2)]] var<storage, write> c: S;
|
||||
@group(1) @binding(1) var<uniform> b: S;
|
||||
@group(1) @binding(2) var<storage, write> c: S;
|
||||
fn f() {
|
||||
let ptr_b = &b;
|
||||
*&a = *ptr_b;
|
||||
@@ -397,14 +394,13 @@ fn f() {
|
||||
TEST(ReplaceIdentifierTest, NotApplicable9) {
|
||||
// Can't replace `b` with `e` since the latter is not a reference.
|
||||
std::string shader = R"(
|
||||
[[block]]
|
||||
struct S {
|
||||
a: i32;
|
||||
};
|
||||
|
||||
var<private> a: S;
|
||||
let e = 3;
|
||||
[[group(1), binding(1)]] var<uniform> b: S;
|
||||
@group(1) @binding(1) var<uniform> b: S;
|
||||
fn f() {
|
||||
*&a = *&b;
|
||||
}
|
||||
@@ -434,14 +430,13 @@ fn f() {
|
||||
TEST(ReplaceIdentifierTest, NotApplicable10) {
|
||||
// Can't replace `b` with `e` since the latter has a wrong access mode.
|
||||
std::string shader = R"(
|
||||
[[block]]
|
||||
struct S {
|
||||
a: i32;
|
||||
};
|
||||
|
||||
var<private> a: S;
|
||||
[[group(0), binding(0)]] var<storage, write> e: S;
|
||||
[[group(1), binding(1)]] var<uniform> b: S;
|
||||
@group(0) @binding(0) var<storage, write> e: S;
|
||||
@group(1) @binding(1) var<uniform> b: S;
|
||||
fn f() {
|
||||
*&a = *&b;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user