mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-12-09 13:38:00 +00:00
wgsl: Deprecate [[access]] decorations
Handle access control on var declarations instead of via [[access]] decorations. This change does the minimal work to migrate the WGSL parser over to the new syntax. Additional changes will be needed to correctly generate defaulted access qualifiers, as well as validating access usage. The [[access]] decorations are still supported by the WGSL parser, with new deprecated warnings, but not for aliases. Example: var x : [[access(x)]] alias_to_struct; Making this work is far more effort than I want to dedicate to backwards compatibility, and I do not beleive any real-world usage will be doing this. Still TODO: * Adding access control as the optional, third parameter to ptr<>. * Calculating default accesses for the various storage types. * Validating usage of variables against the different accesses. Bug: tint:846 Change-Id: If8ca82e5d16ec319ecd01f9a2cafffd930963bde Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/53088 Commit-Queue: Ben Clayton <bclayton@google.com> Reviewed-by: James Price <jrprice@google.com> Reviewed-by: David Neto <dneto@google.com> Kokoro: Kokoro <noreply+kokoro@google.com>
This commit is contained in:
committed by
Tint LUCI CQ
parent
b175d91c7e
commit
93e8f527ee
@@ -8,7 +8,7 @@ struct S {
|
||||
var<private> src_private : ArrayType;
|
||||
var<workgroup> src_workgroup : ArrayType;
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
fn ret_arr() -> ArrayType {
|
||||
return ArrayType();
|
||||
|
||||
@@ -11,7 +11,7 @@ var<workgroup> src_workgroup : ArrayType;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
fn ret_arr() -> ArrayType {
|
||||
return ArrayType();
|
||||
|
||||
@@ -8,7 +8,7 @@ struct S {
|
||||
var<private> src_private : ArrayType;
|
||||
var<workgroup> src_workgroup : ArrayType;
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
var<private> dst : ArrayType;
|
||||
var<private> dst_nested : array<array<array<i32, 2>, 3>, 4>;
|
||||
|
||||
@@ -11,7 +11,7 @@ var<workgroup> src_workgroup : ArrayType;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
var<private> dst : ArrayType;
|
||||
|
||||
|
||||
@@ -13,10 +13,10 @@ struct S_nested {
|
||||
var<private> src_private : ArrayType;
|
||||
var<workgroup> src_workgroup : ArrayType;
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
[[group(0), binding(2)]] var<storage> dst : [[access(read_write)]] S;
|
||||
[[group(0), binding(3)]] var<storage> dst_nested : [[access(read_write)]] S_nested;
|
||||
[[group(0), binding(2)]] var<storage, read_write> dst : S;
|
||||
[[group(0), binding(3)]] var<storage, read_write> dst_nested : S_nested;
|
||||
|
||||
fn ret_arr() -> ArrayType {
|
||||
return ArrayType();
|
||||
|
||||
@@ -16,11 +16,11 @@ var<workgroup> src_workgroup : ArrayType;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
[[group(0), binding(2)]] var<storage> dst : [[access(read_write)]] S;
|
||||
[[group(0), binding(2)]] var<storage, read_write> dst : S;
|
||||
|
||||
[[group(0), binding(3)]] var<storage> dst_nested : [[access(read_write)]] S_nested;
|
||||
[[group(0), binding(3)]] var<storage, read_write> dst_nested : S_nested;
|
||||
|
||||
fn ret_arr() -> ArrayType {
|
||||
return ArrayType();
|
||||
|
||||
@@ -8,7 +8,7 @@ struct S {
|
||||
var<private> src_private : ArrayType;
|
||||
var<workgroup> src_workgroup : ArrayType;
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
var<workgroup> dst : ArrayType;
|
||||
var<workgroup> dst_nested : array<array<array<i32, 2>, 3>, 4>;
|
||||
|
||||
@@ -11,7 +11,7 @@ var<workgroup> src_workgroup : ArrayType;
|
||||
|
||||
[[group(0), binding(0)]] var<uniform> src_uniform : S;
|
||||
|
||||
[[group(0), binding(1)]] var<storage> src_storage : [[access(read_write)]] S;
|
||||
[[group(0), binding(1)]] var<storage, read_write> src_storage : S;
|
||||
|
||||
var<workgroup> dst : ArrayType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user