diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 85a23fb890..ed130db5c7 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -166,8 +166,8 @@ void initSim() { particles : array; }; [[binding(0), group(0)]] var params : SimParams; - [[binding(1), group(0)]] var particlesA : [[access(read)]] Particles; - [[binding(2), group(0)]] var particlesB : [[access(read_write)]] Particles; + [[binding(1), group(0)]] var particlesA : Particles; + [[binding(2), group(0)]] var particlesB : Particles; // https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp [[stage(compute)]] diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp index 70d9a9ce40..eb3d0bf44b 100644 --- a/src/dawn_native/QueryHelper.cpp +++ b/src/dawn_native/QueryHelper.cpp @@ -55,9 +55,9 @@ namespace dawn_native { }; [[group(0), binding(0)]] - var timestamps : [[access(read_write)]] TimestampArr; + var timestamps : TimestampArr; [[group(0), binding(1)]] - var availability : [[access(read)]] AvailabilityArr; + var availability : AvailabilityArr; [[group(0), binding(2)]] var params : TimestampParams; diff --git a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp index ed4727d2c3..f7a5a917a4 100644 --- a/src/dawn_native/d3d12/ShaderModuleD3D12.cpp +++ b/src/dawn_native/d3d12/ShaderModuleD3D12.cpp @@ -234,7 +234,7 @@ namespace dawn_native { namespace d3d12 { bgl->GetBindingInfo(bindingIndex).buffer.type == wgpu::BufferBindingType::Storage); if (forceStorageBufferAsUAV) { - accessControls.emplace(srcBindingPoint, tint::ast::AccessControl::kReadWrite); + accessControls.emplace(srcBindingPoint, tint::ast::Access::kReadWrite); } } } diff --git a/src/tests/DawnTest.cpp b/src/tests/DawnTest.cpp index 0d972fc9cb..3de7da0294 100644 --- a/src/tests/DawnTest.cpp +++ b/src/tests/DawnTest.cpp @@ -1098,7 +1098,7 @@ std::ostringstream& DawnTestBase::ExpectSampledDepthData(wgpu::Texture texture, }; [[group(0), binding(0)]] var tex : texture_depth_2d; - [[group(0), binding(1)]] var result : [[access(read_write)]] Result; + [[group(0), binding(1)]] var result : Result; [[stage(compute)]] fn main( [[builtin(global_invocation_id)]] GlobalInvocationId : vec3 diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index fbe6e523f3..4ab61c471c 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -72,8 +72,8 @@ class BindGroupTests : public DawnTest { << " : Buffer" << i << ";"; break; case wgpu::BufferBindingType::Storage: - fs << "\n[[group(" << i << "), binding(0)]] var buffer" << i - << " : [[access(read)]] Buffer" << i << ";"; + fs << "\n[[group(" << i << "), binding(0)]] var buffer" << i + << " : Buffer" << i << ";"; break; default: UNREACHABLE(); @@ -837,9 +837,9 @@ TEST_P(BindGroupTests, DynamicOffsetOrder) { }; [[group(0), binding(2)]] var buffer2 : Buffer2; - [[group(0), binding(3)]] var buffer3 : [[access(read)]] Buffer3; - [[group(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; - [[group(0), binding(4)]] var outputBuffer : [[access(read_write)]] OutputBuffer; + [[group(0), binding(3)]] var buffer3 : Buffer3; + [[group(0), binding(0)]] var buffer0 : Buffer0; + [[group(0), binding(4)]] var outputBuffer : OutputBuffer; [[stage(compute)]] fn main() { outputBuffer.value = vec3(buffer0.value, buffer2.value, buffer3.value); @@ -1103,7 +1103,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) { [[block]] struct Buffer0 { color : vec4; }; - [[group(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; + [[group(0), binding(0)]] var buffer0 : Buffer0; [[stage(fragment)]] fn main() -> [[location(0)]] vec4 { return buffer0.color; @@ -1240,8 +1240,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { }; )"; interface << "[[group(0), binding(" << binding++ << ")]] " - << "var sbuf" << i << " : [[access(read)]] ReadOnlyStorageBuffer" << i - << ";\n"; + << "var sbuf" << i << " : ReadOnlyStorageBuffer" << i << ";\n"; body << "if (sbuf" << i << ".value != " << expectedValue++ << "u) {\n"; body << " return;\n"; @@ -1257,7 +1256,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { }; )"; interface << "[[group(0), binding(" << binding++ << ")]] " - << "var result : [[access(read_write)]] ReadWriteStorageBuffer;\n"; + << "var result : ReadWriteStorageBuffer;\n"; body << "result.value = 1u;\n"; diff --git a/src/tests/end2end/BufferZeroInitTests.cpp b/src/tests/end2end/BufferZeroInitTests.cpp index 55bdf90f95..78e14787aa 100644 --- a/src/tests/end2end/BufferZeroInitTests.cpp +++ b/src/tests/end2end/BufferZeroInitTests.cpp @@ -1035,7 +1035,7 @@ TEST_P(BufferZeroInitTest, BoundAsReadonlyStorageBuffer) { [[block]] struct SSBO { value : vec4; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[group(0), binding(1)]] var outImage : texture_storage_2d; [[stage(compute)]] fn main() { @@ -1074,7 +1074,7 @@ TEST_P(BufferZeroInitTest, BoundAsStorageBuffer) { [[block]] struct SSBO { value : array, 2>; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[group(0), binding(1)]] var outImage : texture_storage_2d; [[stage(compute)]] fn main() { diff --git a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp index f41da7bebc..721ff210d8 100644 --- a/src/tests/end2end/ComputeCopyStorageBufferTests.cpp +++ b/src/tests/end2end/ComputeCopyStorageBufferTests.cpp @@ -96,8 +96,8 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfBasic) { }; // TODO(crbug.com/tint/386): Use the same struct type - [[set(0), binding(0)]] var src : [[access(read_write)]] Buf1; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Buf2; + [[set(0), binding(0)]] var src : Buf1; + [[set(0), binding(1)]] var dst : Buf2; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -123,8 +123,8 @@ TEST_P(ComputeCopyStorageBufferTests, SizedArrayOfStruct) { }; // TODO(crbug.com/tint/386): Use the same struct type - [[set(0), binding(0)]] var src : [[access(read_write)]] Buf1; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Buf2; + [[set(0), binding(0)]] var src : Buf1; + [[set(0), binding(1)]] var dst : Buf2; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -145,8 +145,8 @@ TEST_P(ComputeCopyStorageBufferTests, UnsizedArrayOfBasic) { }; // TODO(crbug.com/tint/386): Use the same struct type - [[set(0), binding(0)]] var src : [[access(read_write)]] Buf1; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Buf2; + [[set(0), binding(0)]] var src : Buf1; + [[set(0), binding(1)]] var dst : Buf2; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { diff --git a/src/tests/end2end/ComputeDispatchTests.cpp b/src/tests/end2end/ComputeDispatchTests.cpp index 93d844fa96..860aaee9fd 100644 --- a/src/tests/end2end/ComputeDispatchTests.cpp +++ b/src/tests/end2end/ComputeDispatchTests.cpp @@ -37,7 +37,7 @@ class ComputeDispatchTests : public DawnTest { }; [[group(0), binding(0)]] var input : InputBuf; - [[group(0), binding(1)]] var output : [[access(read_write)]] OutputBuf; + [[group(0), binding(1)]] var output : OutputBuf; [[stage(compute), workgroup_size(1, 1, 1)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { diff --git a/src/tests/end2end/ComputeSharedMemoryTests.cpp b/src/tests/end2end/ComputeSharedMemoryTests.cpp index 8ac321291f..3e7e6de929 100644 --- a/src/tests/end2end/ComputeSharedMemoryTests.cpp +++ b/src/tests/end2end/ComputeSharedMemoryTests.cpp @@ -78,7 +78,7 @@ TEST_P(ComputeSharedMemoryTests, Basic) { x : u32; }; - [[group(0), binding(0)]] var dst : [[access(write)]] Dst; + [[group(0), binding(0)]] var dst : Dst; var tmp : u32; [[stage(compute), workgroup_size(4,4,1)]] diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp index 3cfa6dcbfc..777597485d 100644 --- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp +++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp @@ -36,7 +36,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) { data : array; }; - [[group(0), binding(0)]] var buf : [[access(read_write)]] Buf; + [[group(0), binding(0)]] var buf : Buf; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -91,8 +91,8 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { data : array; }; - [[group(0), binding(0)]] var src : [[access(read_write)]] Src; - [[group(0), binding(1)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var src : Src; + [[group(0), binding(1)]] var dst : Dst; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -162,8 +162,8 @@ TEST_P(ComputeStorageBufferBarrierTests, StorageAndReadonlyStoragePingPongInOneP data : array; }; - [[group(0), binding(0)]] var src : [[access(read)]] Src; - [[group(0), binding(1)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var src : Src; + [[group(0), binding(1)]] var dst : Dst; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -231,7 +231,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { }; [[group(0), binding(0)]] var src : Buf; - [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; + [[group(0), binding(1)]] var dst : Buf; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -299,7 +299,7 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) { }; [[group(0), binding(0)]] var src : Buf; - [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; + [[group(0), binding(1)]] var dst : Buf; [[stage(compute)]] fn main([[builtin(global_invocation_id)]] GlobalInvocationID : vec3) { @@ -359,7 +359,7 @@ TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) { [[block]] struct Buf { data : array; }; - [[group(0), binding(0)]] var buf : [[access(read_write)]] Buf; + [[group(0), binding(0)]] var buf : Buf; [[stage(compute)]] fn main() { buf.data = array(1u, 1u, 1u); @@ -373,12 +373,12 @@ TEST_P(ComputeStorageBufferBarrierTests, IndirectBufferCorrectBarrier) { [[block]] struct Buf { data : array; }; - [[group(0), binding(0)]] var buf : [[access(read)]] Buf; + [[group(0), binding(0)]] var buf : Buf; [[block]] struct Result { data : u32; }; - [[group(0), binding(1)]] var result : [[access(read_write)]] Result; + [[group(0), binding(1)]] var result : Result; [[stage(compute)]] fn main() { result.data = 2u; diff --git a/src/tests/end2end/CopyTextureForBrowserTests.cpp b/src/tests/end2end/CopyTextureForBrowserTests.cpp index ffcf2fc8ae..1cce29a455 100644 --- a/src/tests/end2end/CopyTextureForBrowserTests.cpp +++ b/src/tests/end2end/CopyTextureForBrowserTests.cpp @@ -146,7 +146,7 @@ class CopyTextureForBrowserTests : public DawnTest { }; [[group(0), binding(0)]] var src : texture_2d; [[group(0), binding(1)]] var dst : texture_2d; - [[group(0), binding(2)]] var output : [[access(read_write)]] OutputBuf; + [[group(0), binding(2)]] var output : OutputBuf; [[group(0), binding(3)]] var uniforms : Uniforms; fn aboutEqual(value : f32, expect : f32) -> bool { // The value diff should be smaller than the hard coded tolerance. @@ -389,7 +389,6 @@ class CopyTextureForBrowserTests : public DawnTest { // Verify CopyTextureForBrowserTests works with internal pipeline. // The case do copy without any transform. TEST_P(CopyTextureForBrowserTests, PassthroughCopy) { - constexpr uint32_t kWidth = 10; constexpr uint32_t kHeight = 1; @@ -420,7 +419,6 @@ TEST_P(CopyTextureForBrowserTests, VerifyCopyOnYDirection) { } TEST_P(CopyTextureForBrowserTests, VerifyCopyFromLargeTexture) { - constexpr uint32_t kWidth = 899; constexpr uint32_t kHeight = 999; diff --git a/src/tests/end2end/CreatePipelineAsyncTests.cpp b/src/tests/end2end/CreatePipelineAsyncTests.cpp index 44990e031a..c5e76f85d0 100644 --- a/src/tests/end2end/CreatePipelineAsyncTests.cpp +++ b/src/tests/end2end/CreatePipelineAsyncTests.cpp @@ -78,7 +78,7 @@ TEST_P(CreatePipelineAsyncTest, BasicUseOfCreateComputePipelineAsync) { [[block]] struct SSBO { value : u32; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() { ssbo.value = 1u; @@ -113,7 +113,7 @@ TEST_P(CreatePipelineAsyncTest, CreateComputePipelineFailed) { [[block]] struct SSBO { value : u32; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() { ssbo.value = 1u; @@ -312,7 +312,7 @@ TEST_P(CreatePipelineAsyncTest, CreateSameComputePipelineTwice) { [[block]] struct SSBO { value : u32; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() { ssbo.value = 1u; @@ -353,7 +353,7 @@ TEST_P(CreatePipelineAsyncTest, CreateSamePipelineTwiceAtSameTime) { [[block]] struct SSBO { value : u32; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() { ssbo.value = 1u; diff --git a/src/tests/end2end/D3D12CachingTests.cpp b/src/tests/end2end/D3D12CachingTests.cpp index fde7d6cd94..ecf7c8b96a 100644 --- a/src/tests/end2end/D3D12CachingTests.cpp +++ b/src/tests/end2end/D3D12CachingTests.cpp @@ -211,7 +211,7 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPoints) { [[block]] struct Data { data : u32; }; - [[binding(0), group(0)]] var data : [[access(read_write)]] Data; + [[binding(0), group(0)]] var data : Data; [[stage(compute)]] fn write1() { data.data = 1u; diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp index 1b7e5842f3..d0681a09be 100644 --- a/src/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/tests/end2end/DepthStencilSamplingTests.cpp @@ -141,8 +141,8 @@ class DepthStencilSamplingTest : public DawnTest { << " : texture_2d;\n"; shaderSource << "[[group(0), binding(" << 2 * index + 1 - << ")]] var result" << index - << " : [[access(read_write)]] DepthResult;\n"; + << ")]] var result" << index + << " : DepthResult;\n"; shaderBody << "\nresult" << index << ".value = textureLoad(tex" << index << ", vec2(0, 0), 0)[" << componentIndex << "];"; @@ -152,8 +152,8 @@ class DepthStencilSamplingTest : public DawnTest { << " : texture_2d;\n"; shaderSource << "[[group(0), binding(" << 2 * index + 1 - << ")]] var result" << index - << " : [[access(read_write)]] StencilResult;\n"; + << ")]] var result" << index + << " : StencilResult;\n"; shaderBody << "\nresult" << index << ".value = textureLoad(tex" << index << ", vec2(0, 0), 0)[" << componentIndex << "];"; @@ -221,7 +221,7 @@ class DepthStencilSamplingTest : public DawnTest { [[block]] struct SamplerResult { value : f32; }; - [[group(0), binding(3)]] var samplerResult : [[access(read_write)]] SamplerResult; + [[group(0), binding(3)]] var samplerResult : SamplerResult; [[stage(compute)]] fn main() { samplerResult.value = textureSampleCompare(tex, samp, vec2(0.5, 0.5), uniforms.compareRef); diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp index 33de9efe8b..32821fd3eb 100644 --- a/src/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp @@ -125,9 +125,9 @@ class DynamicBufferOffsetTests : public DawnTest { }; [[group(0), binding(0)]] var uBufferNotDynamic : Buffer1; - [[group(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; + [[group(0), binding(1)]] var sBufferNotDynamic : Buffer2; [[group(0), binding(3)]] var uBuffer : Buffer3; - [[group(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; + [[group(0), binding(4)]] var sBuffer : Buffer4; )"; if (isInheritedPipeline) { @@ -192,9 +192,9 @@ class DynamicBufferOffsetTests : public DawnTest { }; [[group(0), binding(0)]] var uBufferNotDynamic : Buffer1; - [[group(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; + [[group(0), binding(1)]] var sBufferNotDynamic : Buffer2; [[group(0), binding(3)]] var uBuffer : Buffer3; - [[group(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; + [[group(0), binding(4)]] var sBuffer : Buffer4; )"; if (isInheritedPipeline) { diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp index 037d6ed9bb..da5d5db638 100644 --- a/src/tests/end2end/EntryPointTests.cpp +++ b/src/tests/end2end/EntryPointTests.cpp @@ -64,7 +64,7 @@ TEST_P(EntryPointTests, TwoComputeInModule) { [[block]] struct Data { data : u32; }; - [[binding(0), group(0)]] var data : [[access(read_write)]] Data; + [[binding(0), group(0)]] var data : Data; [[stage(compute)]] fn write1() { data.data = 1u; diff --git a/src/tests/end2end/FirstIndexOffsetTests.cpp b/src/tests/end2end/FirstIndexOffsetTests.cpp index b6e56d7a96..506c0d317d 100644 --- a/src/tests/end2end/FirstIndexOffsetTests.cpp +++ b/src/tests/end2end/FirstIndexOffsetTests.cpp @@ -132,7 +132,7 @@ struct VertexOutputs { vertex_index : u32; instance_index : u32; }; -[[group(0), binding(0)]] var idx_vals : [[access(read_write)]] IndexVals; +[[group(0), binding(0)]] var idx_vals : IndexVals; struct FragInputs { )" + fragmentInputs.str() + R"( diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index 1db5400ff1..7113a139ac 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -39,7 +39,7 @@ class GpuMemorySyncTests : public DawnTest { [[block]] struct Data { a : i32; }; - [[group(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : Data; [[stage(compute)]] fn main() { data.a = data.a + 1; })"); @@ -66,7 +66,7 @@ class GpuMemorySyncTests : public DawnTest { [[block]] struct Data { i : i32; }; - [[group(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : Data; [[stage(fragment)]] fn main() -> [[location(0)]] vec4 { data.i = data.i + 1; return vec4(f32(data.i) / 255.0, 0.0, 0.0, 1.0); @@ -255,7 +255,7 @@ TEST_P(GpuMemorySyncTests, SampledAndROStorageTextureInComputePass) { sampledOut: u32; storageOut: u32; }; - [[group(0), binding(0)]] var output : [[access(write)]] Output; + [[group(0), binding(0)]] var output : Output; [[group(0), binding(1)]] var sampledTex : texture_2d; [[group(0), binding(2)]] var storageTex : texture_storage_2d; @@ -315,7 +315,7 @@ class StorageToUniformSyncTests : public DawnTest { [[block]] struct Data { a : f32; }; - [[group(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : Data; [[stage(compute)]] fn main() { data.a = 1.0; })"); @@ -512,12 +512,12 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[block]] struct VBContents { pos : array, 4>; }; - [[group(0), binding(0)]] var vbContents : [[access(read_write)]] VBContents; + [[group(0), binding(0)]] var vbContents : VBContents; [[block]] struct IBContents { indices : array, 2>; }; - [[group(0), binding(1)]] var ibContents : [[access(read_write)]] IBContents; + [[group(0), binding(1)]] var ibContents : IBContents; // TODO(crbug.com/tint/386): Use the same struct. [[block]] struct ColorContents1 { @@ -526,8 +526,8 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[block]] struct ColorContents2 { color : f32; }; - [[group(0), binding(2)]] var uniformContents : [[access(read_write)]] ColorContents1; - [[group(0), binding(3)]] var storageContents : [[access(read_write)]] ColorContents2; + [[group(0), binding(2)]] var uniformContents : ColorContents1; + [[group(0), binding(3)]] var storageContents : ColorContents2; [[stage(compute)]] fn main() { vbContents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); @@ -581,7 +581,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { }; [[group(0), binding(0)]] var uniformBuffer : Buf; - [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; + [[group(0), binding(1)]] var storageBuffer : Buf; [[stage(fragment)]] fn main() -> [[location(0)]] vec4 { return vec4(uniformBuffer.color, storageBuffer.color, 0.0, 1.0); @@ -642,7 +642,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { [[align(256)]] color1 : f32; }; - [[group(0), binding(0)]] var contents : [[access(read_write)]] Contents; + [[group(0), binding(0)]] var contents : Contents; [[stage(compute)]] fn main() { contents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); @@ -696,7 +696,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { color : f32; }; [[group(0), binding(0)]] var uniformBuffer : Buf; - [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; + [[group(0), binding(1)]] var storageBuffer : Buf; [[stage(fragment)]] fn main() -> [[location(0)]] vec4 { return vec4(uniformBuffer.color, storageBuffer.color, 0.0, 1.0); diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp index 055f2c1acf..39e6103f26 100644 --- a/src/tests/end2end/MultisampledSamplingTests.cpp +++ b/src/tests/end2end/MultisampledSamplingTests.cpp @@ -100,7 +100,7 @@ class MultisampledSamplingTest : public DawnTest { colorSamples : array; depthSamples : array; }; - [[group(0), binding(2)]] var results : [[access(read_write)]] Results; + [[group(0), binding(2)]] var results : Results; [[stage(compute)]] fn main() { for (var i : i32 = 0; i < 4; i = i + 1) { diff --git a/src/tests/end2end/OpArrayLengthTests.cpp b/src/tests/end2end/OpArrayLengthTests.cpp index c9d42f7f21..b7b55bf124 100644 --- a/src/tests/end2end/OpArrayLengthTests.cpp +++ b/src/tests/end2end/OpArrayLengthTests.cpp @@ -63,10 +63,10 @@ class OpArrayLengthTest : public DawnTest { }; // The length should be 1 because the buffer is 4-byte long. - [[group(0), binding(0)]] var buffer1 : [[access(read)]] DataBuffer1; + [[group(0), binding(0)]] var buffer1 : DataBuffer1; // The length should be 64 because the buffer is 256 bytes long. - [[group(0), binding(1)]] var buffer2 : [[access(read)]] DataBuffer2; + [[group(0), binding(1)]] var buffer2 : DataBuffer2; // The length should be (512 - 16*4) / 8 = 56 because the buffer is 512 bytes long // and the structure is 8 bytes big. @@ -79,7 +79,7 @@ class OpArrayLengthTest : public DawnTest { [[size(64)]] garbage : mat4x4; data : [[stride(8)]] array; }; - [[group(0), binding(2)]] var buffer3 : [[access(read)]] Buffer3; + [[group(0), binding(2)]] var buffer3 : Buffer3; )"; // See comments in the shader for an explanation of these values @@ -128,7 +128,7 @@ TEST_P(OpArrayLengthTest, Compute) { [[block]] struct ResultBuffer { data : [[stride(4)]] array; }; - [[group(1), binding(0)]] var result : [[access(read_write)]] ResultBuffer; + [[group(1), binding(0)]] var result : ResultBuffer; )" + mShaderInterface + R"( [[stage(compute)]] fn main() { result.data[0] = arrayLength(buffer1.data); diff --git a/src/tests/end2end/ShaderTests.cpp b/src/tests/end2end/ShaderTests.cpp index 7c9475c2db..ace5c8f722 100644 --- a/src/tests/end2end/ShaderTests.cpp +++ b/src/tests/end2end/ShaderTests.cpp @@ -35,7 +35,7 @@ TEST_P(ShaderTests, ComputeLog2) { data : array; }; -[[group(0), binding(0)]] var buf : [[access(read_write)]] Buf; +[[group(0), binding(0)]] var buf : Buf; [[stage(compute)]] fn main() { let factor : f32 = 1.0001; diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp index 0ab4a0acc9..a25aa53bb3 100644 --- a/src/tests/end2end/StorageTextureTests.cpp +++ b/src/tests/end2end/StorageTextureTests.cpp @@ -167,12 +167,12 @@ class StorageTextureTests : public DawnTest { std::ostringstream ostream; ostream << "[[group(0), binding(" << binding << ")]] " << "var storageImage" << binding << " : " - << "[[access(" << accessQualifier << ")]] " << "texture_storage_2d"; if (is2DArray) { ostream << "_array"; } - ostream << "<" << utils::GetWGSLImageFormatQualifier(format) << ">;"; + ostream << "<" << utils::GetWGSLImageFormatQualifier(format) << ", "; + ostream << accessQualifier << ">;"; return ostream.str(); } @@ -710,7 +710,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { result : u32; }; -[[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )" << CommonReadOnlyTestCode(format) << R"( [[stage(compute)]] fn main() { @@ -934,7 +934,7 @@ TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { result : u32; }; -[[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )" << CommonReadOnlyTestCode(kTextureFormat, true) << R"( [[stage(compute)]] fn main() { @@ -1202,7 +1202,7 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputeP }; [[group(0), binding(0)]] var srcImage : texture_storage_2d; -[[group(0), binding(1)]] var dstBuffer : [[access(read_write)]] DstBuffer; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )") + kCommonReadOnlyZeroInitTestCode + R"( [[stage(compute)]] fn main() { if (doTest()) { diff --git a/src/tests/end2end/TextureZeroInitTests.cpp b/src/tests/end2end/TextureZeroInitTests.cpp index 3f2e8eec7f..f8a03d5163 100644 --- a/src/tests/end2end/TextureZeroInitTests.cpp +++ b/src/tests/end2end/TextureZeroInitTests.cpp @@ -979,7 +979,7 @@ TEST_P(TextureZeroInitTest, ComputePassSampledTextureClear) { [[block]] struct Result { value : vec4; }; - [[group(0), binding(1)]] var result : [[access(read_write)]] Result; + [[group(0), binding(1)]] var result : Result; [[stage(compute)]] fn main() { result.value = textureLoad(tex, vec2(0,0), 0); } diff --git a/src/tests/perf_tests/ShaderRobustnessPerf.cpp b/src/tests/perf_tests/ShaderRobustnessPerf.cpp index 0add757a65..f63af7b702 100644 --- a/src/tests/perf_tests/ShaderRobustnessPerf.cpp +++ b/src/tests/perf_tests/ShaderRobustnessPerf.cpp @@ -29,9 +29,9 @@ namespace { numbers: array; }; - [[group(0), binding(0)]] var firstMatrix : [[access(read)]] Matrix; - [[group(0), binding(1)]] var secondMatrix : [[access(read)]] Matrix; - [[group(0), binding(2)]] var resultMatrix : [[access(write)]] Matrix; + [[group(0), binding(0)]] var firstMatrix : Matrix; + [[group(0), binding(1)]] var secondMatrix : Matrix; + [[group(0), binding(2)]] var resultMatrix : Matrix; [[group(0), binding(3)]] var uniforms : Uniforms; fn mm_readA(row : u32, col : u32) -> f32 { @@ -196,9 +196,9 @@ namespace { numbers: array>; }; - [[group(0), binding(0)]] var firstMatrix : [[access(read)]] Matrix; - [[group(0), binding(1)]] var secondMatrix : [[access(read)]] Matrix; - [[group(0), binding(2)]] var resultMatrix : [[access(write)]] Matrix; + [[group(0), binding(0)]] var firstMatrix : Matrix; + [[group(0), binding(1)]] var secondMatrix : Matrix; + [[group(0), binding(2)]] var resultMatrix : Matrix; [[group(0), binding(3)]] var uniforms : Uniforms; fn mm_readA(row : u32, col : u32) -> vec4 { diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 33c656ffd6..b41b8c4929 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -1278,8 +1278,8 @@ class SetBindGroupValidationTest : public ValidationTest { [[group(0), binding(0)]] var uBufferDynamic : S; [[group(0), binding(1)]] var uBuffer : S; - [[group(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; - [[group(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(2)]] var sBufferDynamic : S; + [[group(0), binding(3)]] var sReadonlyBufferDynamic : S; [[stage(fragment)]] fn main() { })"); @@ -1301,8 +1301,8 @@ class SetBindGroupValidationTest : public ValidationTest { [[group(0), binding(0)]] var uBufferDynamic : S; [[group(0), binding(1)]] var uBuffer : S; - [[group(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; - [[group(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(2)]] var sBufferDynamic : S; + [[group(0), binding(3)]] var sReadonlyBufferDynamic : S; [[stage(compute), workgroup_size(4, 4, 1)]] fn main() { })"); @@ -1728,8 +1728,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { ss << "[[group(" << l << "), binding(" << b << ")]] "; switch (binding) { case wgpu::BufferBindingType::Storage: - ss << "var set" << l << "_binding" << b - << " : [[access(read_write)]] S;"; + ss << "var set" << l << "_binding" << b << " : S;"; break; case wgpu::BufferBindingType::Uniform: ss << "var set" << l << "_binding" << b << " : S;"; @@ -1897,8 +1896,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { value : vec2; }; - [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; - [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(0)]] var sBufferDynamic : S; + [[group(1), binding(0)]] var sReadonlyBufferDynamic : S; [[stage(fragment)]] fn main() { var val : vec2 = sBufferDynamic.value; @@ -1932,8 +1931,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { value : vec2; }; - [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; - [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(0)]] var sBufferDynamic : S; + [[group(1), binding(0)]] var sReadonlyBufferDynamic : S; [[stage(compute), workgroup_size(4, 4, 1)]] fn main() { var val : vec2 = sBufferDynamic.value; diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp index de024b0c81..a0a531a7f6 100644 --- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp +++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp @@ -66,7 +66,7 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { [[block]] struct S3 { pos : mat4x4; }; - [[group(3), binding(0)]] var storage3 : [[access(read_write)]] S3; + [[group(3), binding(0)]] var storage3 : S3; [[stage(fragment)]] fn main() { var pos_u : vec4 = uniform2.pos; @@ -202,7 +202,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[block]] struct S { pos : vec4; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] S; + [[group(0), binding(0)]] var ssbo : S; [[stage(fragment)]] fn main() { var pos : vec4 = ssbo.pos; @@ -229,7 +229,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[block]] struct S { pos : vec4; }; - [[group(0), binding(0)]] var ssbo : [[access(read)]] S; + [[group(0), binding(0)]] var ssbo : S; [[stage(fragment)]] fn main() { var pos : vec4 = ssbo.pos; @@ -707,7 +707,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { [[block]] struct S { pos : vec4; }; - [[group(0), binding(0)]] var ssbo : [[access(read_write)]] S; + [[group(0), binding(0)]] var ssbo : S; [[stage(fragment)]] fn main() { var pos : vec4 = ssbo.pos; @@ -912,8 +912,8 @@ TEST_F(GetBindGroupLayoutTests, FromCorrectEntryPoint) { [[block]] struct Data { data : f32; }; - [[group(0), binding(0)]] var data0 : [[access(read_write)]] Data; - [[group(0), binding(1)]] var data1 : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data0 : Data; + [[group(0), binding(1)]] var data1 : Data; [[stage(compute)]] fn compute0() { data0.data = 0.0; diff --git a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp index de4ec17ad0..df880252a6 100644 --- a/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp +++ b/src/tests/unittests/validation/MinimumBufferSizeValidationTests.cpp @@ -80,12 +80,10 @@ namespace { ostream << "var b" << index << " : S" << index << ";\n"; break; case wgpu::BufferBindingType::Storage: - ostream << "var b" << index << " : [[access(read_write)]] S" << index - << ";\n"; + ostream << "var b" << index << " : S" << index << ";\n"; break; case wgpu::BufferBindingType::ReadOnlyStorage: - ostream << "var b" << index << " : [[access(read)]] S" << index - << ";\n"; + ostream << "var b" << index << " : S" << index << ";\n"; break; default: UNREACHABLE(); diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp index 11277b2f0a..b6da94e950 100644 --- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp +++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp @@ -46,7 +46,7 @@ namespace { [[block]] struct Storage { dummy : array; }; - [[group(1), binding(1)]] var ssbo : [[access(read_write)]] Storage; + [[group(1), binding(1)]] var ssbo : Storage; [[stage(fragment)]] fn main() { })"); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index 37f156f0fe..593a36599b 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -460,7 +460,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) { [[block]] struct Dst { data : array; }; - [[group(0), binding(0)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var dst : Dst; [[stage(vertex)]] fn main([[builtin(vertex_index)]] VertexIndex : u32) -> [[builtin(position)]] vec4 { dst.data[VertexIndex] = 0x1234u; return vec4(); diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp index 142ba56aa7..d70ef9ad5e 100644 --- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp +++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp @@ -762,7 +762,7 @@ namespace { [[block]] struct RBuffer { value : f32; }; - [[group(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; + [[group(0), binding(0)]] var rBuffer : RBuffer; [[stage(fragment)]] fn main() { })"); utils::ComboRenderPipelineDescriptor pipelineDescriptor; diff --git a/src/tests/unittests/validation/StorageTextureValidationTests.cpp b/src/tests/unittests/validation/StorageTextureValidationTests.cpp index 5294c0f3f6..a212e10a60 100644 --- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -82,9 +82,8 @@ class StorageTextureValidationTests : public ValidationTest { } std::ostringstream ostream; - ostream << "[[group(0), binding(0)]] var image0 : " - << "[[access(" << access << ")]] " << imageTypeDeclaration << "<" - << imageFormatQualifier + ostream << "[[group(0), binding(0)]] var image0 : " << imageTypeDeclaration << "<" + << imageFormatQualifier << ", " << access << ">;\n" "[[stage(compute)]] fn main() {\n" " textureDimensions(image0);\n" @@ -193,7 +192,7 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) { [[block]] struct Buf { data : f32; }; - [[group(0), binding(1)]] var buf : [[access(read_write)]] Buf; + [[group(0), binding(1)]] var buf : Buf; [[stage(compute)]] fn main([[builtin(local_invocation_id)]] LocalInvocationID : vec3) { buf.data = textureLoad(image0, vec2(LocalInvocationID.xy)).x;