Update texture storage syntax.
This CL updates the WGSL texture storage syntax to use the access
decoration.
Bug: tint:286
Change-Id: I0024a0682c6a6479eb7a8436f8df4c9a76ec5e2a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/37880
Commit-Queue: dan sinclair <dsinclair@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp
index 2686775..8597924 100644
--- a/src/tests/end2end/BindGroupTests.cpp
+++ b/src/tests/end2end/BindGroupTests.cpp
@@ -1237,7 +1237,8 @@
bgEntries.push_back({binding, nullptr, 0, 0, nullptr, texture.CreateView()});
interface << "[[set(0), binding(" << binding++ << ")]] "
- << "var<uniform_constant> image" << i << " : texture_storage_ro_2d<r32uint>;\n";
+ << "var<uniform_constant> image" << i
+ << " : [[access(read)]] texture_storage_2d<r32uint>;\n";
body << "if (textureLoad(image" << i << ", vec2<i32>(0, 0)).r != " << expectedValue++
<< "u) {\n";
diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
index 2b8950f..3b01ca6 100644
--- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
+++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp
@@ -1554,7 +1554,7 @@
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
- [[set(0), binding(0)]] var<uniform_constant> tex : texture_storage_ro_2d<rgba8unorm>;
+ [[set(0), binding(0)]] var<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main() -> void {
})");
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
@@ -1580,7 +1580,7 @@
{
// Create a passthrough compute pipeline with a readonly storage texture
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
- [[set(0), binding(0)]] var<uniform_constant> tex : texture_storage_ro_2d<rgba8unorm>;
+ [[set(0), binding(0)]] var<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(compute)]] fn main() -> void {
})");
wgpu::ComputePipelineDescriptor pipelineDescriptor;
diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
index a5701d8..ce63cd2 100644
--- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp
+++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp
@@ -125,7 +125,7 @@
// Readonly storage texture can be declared in a vertex shader.
{
wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"(
- [[set(0), binding(0)]] var<uniform_constant> image0 : texture_storage_ro_2d<rgba8unorm>;
+ [[set(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
@@ -142,7 +142,7 @@
// Read-only storage textures can be declared in a fragment shader.
{
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
- [[set(0), binding(0)]] var<uniform_constant> image0 : texture_storage_ro_2d<rgba8unorm>;
+ [[set(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(frag_coord)]] var<in> FragCoord : vec4<f32>;
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
@@ -197,7 +197,7 @@
// Read-only storage textures can be declared in a compute shader.
{
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
- [[set(0), binding(0)]] var<uniform_constant> image0 : texture_storage_ro_2d<rgba8unorm>;
+ [[set(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(local_invocation_id)]] var<in> LocalInvocationID : vec3<u32>;
[[block]] struct Buf {