diff --git a/examples/ComputeBoids.cpp b/examples/ComputeBoids.cpp index 7bf1062d00..a90d9e3694 100644 --- a/examples/ComputeBoids.cpp +++ b/examples/ComputeBoids.cpp @@ -167,9 +167,9 @@ void initSim() { [[block]] struct Particles { [[offset(0)]] particles : [[stride(16)]] array; }; - [[binding(0), set(0)]] var params : SimParams; - [[binding(1), set(0)]] var particlesA : [[access(read)]] Particles; - [[binding(2), set(0)]] var particlesB : [[access(read_write)]] Particles; + [[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; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; // https://github.com/austinEng/Project6-Vulkan-Flocking/blob/master/data/shaders/computeparticles/particle.comp diff --git a/examples/CppHelloTriangle.cpp b/examples/CppHelloTriangle.cpp index 08fd4c54c3..fdaa22100a 100644 --- a/examples/CppHelloTriangle.cpp +++ b/examples/CppHelloTriangle.cpp @@ -105,8 +105,8 @@ void init() { wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( [[builtin(frag_coord)]] var FragCoord : vec4; - [[set(0), binding(0)]] var mySampler: sampler; - [[set(0), binding(1)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(1)]] var myTexture : texture_2d; [[location(0)]] var FragColor : vec4; [[stage(fragment)]] fn main() -> void { diff --git a/examples/CubeReflection.cpp b/examples/CubeReflection.cpp index 060bd300c4..eab5071f1c 100644 --- a/examples/CubeReflection.cpp +++ b/examples/CubeReflection.cpp @@ -106,12 +106,12 @@ void init() { [[offset(0)]] view : mat4x4; [[offset(64)]] proj : mat4x4; }; - [[set(0), binding(0)]] var camera : Camera; + [[group(0), binding(0)]] var camera : Camera; [[block]] struct Model { [[offset(0)]] matrix : mat4x4; }; - [[set(0), binding(1)]] var model : Model; + [[group(0), binding(1)]] var model : Model; [[location(0)]] var pos : vec3; [[location(1)]] var col : vec3; diff --git a/src/dawn_native/CopyTextureForBrowserHelper.cpp b/src/dawn_native/CopyTextureForBrowserHelper.cpp index b8bc2a4a9d..51b36edbc4 100644 --- a/src/dawn_native/CopyTextureForBrowserHelper.cpp +++ b/src/dawn_native/CopyTextureForBrowserHelper.cpp @@ -45,7 +45,7 @@ namespace dawn_native { [[location(0)]] var v_texcoord: vec2; [[builtin(position)]] var Position : vec4; [[builtin(vertex_idx)]] var VertexIndex : u32; - [[binding(0), set(0)]] var uniforms : Uniforms; + [[binding(0), group(0)]] var uniforms : Uniforms; [[stage(vertex)]] fn main() -> void { Position = vec4((texcoord[VertexIndex] * 2.0 - vec2(1.0, 1.0)), 0.0, 1.0); @@ -57,8 +57,8 @@ namespace dawn_native { )"; static const char sPassthrough2D4ChannelFrag[] = R"( - [[binding(1), set(0)]] var mySampler: sampler; - [[binding(2), set(0)]] var myTexture: texture_2d; + [[binding(1), group(0)]] var mySampler: sampler; + [[binding(2), group(0)]] var myTexture: texture_2d; [[location(0)]] var v_texcoord : vec2; [[location(0)]] var rgbaColor : vec4; [[stage(fragment)]] fn main() -> void { diff --git a/src/dawn_native/QueryHelper.cpp b/src/dawn_native/QueryHelper.cpp index 43b82606b7..e02272f0a6 100644 --- a/src/dawn_native/QueryHelper.cpp +++ b/src/dawn_native/QueryHelper.cpp @@ -52,11 +52,11 @@ namespace dawn_native { [[offset(8)]] period : f32; }; - [[set(0), binding(0)]] + [[group(0), binding(0)]] var timestamps : [[access(read_write)]] TimestampArr; - [[set(0), binding(1)]] + [[group(0), binding(1)]] var availability : [[access(read)]] AvailabilityArr; - [[set(0), binding(2)]] var params : TimestampParams; + [[group(0), binding(2)]] var params : TimestampParams; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; diff --git a/src/tests/end2end/BindGroupTests.cpp b/src/tests/end2end/BindGroupTests.cpp index 8597924033..6f2c51f571 100644 --- a/src/tests/end2end/BindGroupTests.cpp +++ b/src/tests/end2end/BindGroupTests.cpp @@ -72,11 +72,11 @@ class BindGroupTests : public DawnTest { switch (bindingTypes[i]) { case wgpu::BufferBindingType::Uniform: - fs << "\n[[set(" << i << "), binding(0)]] var buffer" << i + fs << "\n[[group(" << i << "), binding(0)]] var buffer" << i << " : Buffer" << i << ";"; break; case wgpu::BufferBindingType::Storage: - fs << "\n[[set(" << i << "), binding(0)]] var buffer" << i + fs << "\n[[group(" << i << "), binding(0)]] var buffer" << i << " : [[access(read)]] Buffer" << i << ";"; break; default: @@ -123,7 +123,7 @@ TEST_P(BindGroupTests, ReusedBindGroupSingleSubmit) { [[block]] struct Contents { [[offset(0)]] f : f32; }; - [[set(0), binding(0)]] var contents: Contents; + [[group(0), binding(0)]] var contents: Contents; [[stage(compute)]] fn main() -> void { })"); @@ -162,7 +162,7 @@ TEST_P(BindGroupTests, ReusedUBO) { [[offset(0)]] transform : vec4; }; - [[set(0), binding(0)]] var vertexUbo : VertexUniformBuffer; + [[group(0), binding(0)]] var vertexUbo : VertexUniformBuffer; [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; @@ -183,7 +183,7 @@ TEST_P(BindGroupTests, ReusedUBO) { [[block]] struct FragmentUniformBuffer { [[offset(0)]] color : vec4; }; - [[set(0), binding(1)]] var fragmentUbo : FragmentUniformBuffer; + [[group(0), binding(1)]] var fragmentUbo : FragmentUniformBuffer; [[location(0)]] var fragColor : vec4; @@ -249,7 +249,7 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { [[block]] struct VertexUniformBuffer { [[offset(0)]] transform : vec4; }; - [[set(0), binding(0)]] var vertexUbo : VertexUniformBuffer; + [[group(0), binding(0)]] var vertexUbo : VertexUniformBuffer; [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; @@ -267,8 +267,8 @@ TEST_P(BindGroupTests, UBOSamplerAndTexture) { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(1)]] var samp : sampler; - [[set(0), binding(2)]] var tex : texture_2d; + [[group(0), binding(1)]] var samp : sampler; + [[group(0), binding(2)]] var tex : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; [[location(0)]] var fragColor : vec4; @@ -371,8 +371,8 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { }; // TODO(crbug.com/tint/386): Use the same struct definition. - [[set(0), binding(0)]] var vertexUbo1 : VertexUniformBuffer1; - [[set(1), binding(0)]] var vertexUbo2 : VertexUniformBuffer2; + [[group(0), binding(0)]] var vertexUbo1 : VertexUniformBuffer1; + [[group(1), binding(0)]] var vertexUbo2 : VertexUniformBuffer2; [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; @@ -400,8 +400,8 @@ TEST_P(BindGroupTests, MultipleBindLayouts) { }; // TODO(crbug.com/tint/386): Use the same struct definition. - [[set(0), binding(1)]] var fragmentUbo1 : FragmentUniformBuffer1; - [[set(1), binding(1)]] var fragmentUbo2 : FragmentUniformBuffer2; + [[group(0), binding(1)]] var fragmentUbo1 : FragmentUniformBuffer1; + [[group(1), binding(1)]] var fragmentUbo2 : FragmentUniformBuffer2; [[location(0)]] var fragColor : vec4; @@ -863,10 +863,10 @@ TEST_P(BindGroupTests, DynamicOffsetOrder) { [[offset(0)]] value : vec3; }; - [[set(0), binding(2)]] var buffer2 : Buffer2; - [[set(0), binding(3)]] var buffer3 : [[access(read)]] Buffer3; - [[set(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; - [[set(0), binding(4)]] var outputBuffer : [[access(read_write)]] OutputBuffer; + [[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; [[stage(compute)]] fn main() -> void { outputBuffer.value = vec3(buffer0.value, buffer2.value, buffer3.value); @@ -988,9 +988,9 @@ TEST_P(BindGroupTests, ArbitraryBindingNumbers) { }; // TODO(crbug.com/tint/386): Use the same struct definition. - [[set(0), binding(953)]] var ubo1 : Ubo1; - [[set(0), binding(47)]] var ubo2 : Ubo2; - [[set(0), binding(111)]] var ubo3 : Ubo3; + [[group(0), binding(953)]] var ubo1 : Ubo1; + [[group(0), binding(47)]] var ubo2 : Ubo2; + [[group(0), binding(111)]] var ubo3 : Ubo3; [[location(0)]] var fragColor : vec4; @@ -1133,7 +1133,7 @@ TEST_P(BindGroupTests, ReadonlyStorage) { [[block]] struct Buffer0 { [[offset(0)]] color : vec4; }; - [[set(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; + [[group(0), binding(0)]] var buffer0 : [[access(read)]] Buffer0; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { @@ -1216,13 +1216,13 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { wgpu::TextureFormat::R8Unorm, expectedValue, wgpu::TextureUsage::Sampled); bgEntries.push_back({binding, nullptr, 0, 0, nullptr, texture.CreateView()}); - interface << "[[set(0), binding(" << binding++ << ")]] " + interface << "[[group(0), binding(" << binding++ << ")]] " << "var tex" << i << " : texture_2d;\n"; wgpu::SamplerDescriptor samplerDesc = {}; bgEntries.push_back({binding, nullptr, 0, 0, device.CreateSampler(&samplerDesc), nullptr}); - interface << "[[set(0), binding(" << binding++ << ")]]" + interface << "[[group(0), binding(" << binding++ << ")]]" << "var samp" << i << " : sampler;\n"; body << "if (abs(textureSampleLevel(tex" << i << ", samp" << i @@ -1236,7 +1236,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { wgpu::TextureFormat::R32Uint, expectedValue, wgpu::TextureUsage::Storage); bgEntries.push_back({binding, nullptr, 0, 0, nullptr, texture.CreateView()}); - interface << "[[set(0), binding(" << binding++ << ")]] " + interface << "[[group(0), binding(" << binding++ << ")]] " << "var image" << i << " : [[access(read)]] texture_storage_2d;\n"; @@ -1255,7 +1255,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { [[offset(0)]] value : u32; }; )"; - interface << "[[set(0), binding(" << binding++ << ")]] " + interface << "[[group(0), binding(" << binding++ << ")]] " << "var ubuf" << i << " : UniformBuffer" << i << ";\n"; body << "if (ubuf" << i << ".value != " << expectedValue++ << "u) {\n"; @@ -1272,7 +1272,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { [[offset(0)]] value : u32; }; )"; - interface << "[[set(0), binding(" << binding++ << ")]] " + interface << "[[group(0), binding(" << binding++ << ")]] " << "var sbuf" << i << " : [[access(read)]] ReadOnlyStorageBuffer" << i << ";\n"; @@ -1289,7 +1289,7 @@ TEST_P(BindGroupTests, ReallyLargeBindGroup) { [[offset(0)]] value : u32; }; )"; - interface << "[[set(0), binding(" << binding++ << ")]] " + interface << "[[group(0), binding(" << binding++ << ")]] " << "var result : [[access(read_write)]] ReadWriteStorageBuffer;\n"; body << "result.value = 1u;\n"; diff --git a/src/tests/end2end/ColorStateTests.cpp b/src/tests/end2end/ColorStateTests.cpp index 973a923c2e..79747ee04a 100644 --- a/src/tests/end2end/ColorStateTests.cpp +++ b/src/tests/end2end/ColorStateTests.cpp @@ -60,7 +60,7 @@ class ColorStateTest : public DawnTest { [[offset(0)]] color : vec4; }; - [[set(0), binding(0)]] var myUbo : MyBlock; + [[group(0), binding(0)]] var myUbo : MyBlock; [[location(0)]] var fragColor : vec4; @@ -777,7 +777,7 @@ TEST_P(ColorStateTest, IndependentColorState) { [[offset(48)]] color3 : vec4; }; - [[set(0), binding(0)]] var myUbo : MyBlock; + [[group(0), binding(0)]] var myUbo : MyBlock; [[location(0)]] var fragColor0 : vec4; [[location(1)]] var fragColor1 : vec4; @@ -884,7 +884,7 @@ TEST_P(ColorStateTest, DefaultBlendColor) { [[offset(0)]] color : vec4; }; - [[set(0), binding(0)]] var myUbo : MyBlock; + [[group(0), binding(0)]] var myUbo : MyBlock; [[location(0)]] var fragColor : vec4; @@ -1007,7 +1007,7 @@ TEST_P(ColorStateTest, ColorWriteMaskDoesNotAffectRenderPassLoadOpClear) { [[offset(0)]] color : vec4; }; - [[set(0), binding(0)]] var myUbo : MyBlock; + [[group(0), binding(0)]] var myUbo : MyBlock; [[location(0)]] var fragColor : vec4; diff --git a/src/tests/end2end/CompressedTextureFormatTests.cpp b/src/tests/end2end/CompressedTextureFormatTests.cpp index 4453505251..f953839623 100644 --- a/src/tests/end2end/CompressedTextureFormatTests.cpp +++ b/src/tests/end2end/CompressedTextureFormatTests.cpp @@ -156,8 +156,8 @@ class CompressedTextureBCFormatTest : public DawnTest { return; })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var sampler0 : sampler; - [[set(0), binding(1)]] var texture0 : texture_2d; + [[group(0), binding(0)]] var sampler0 : sampler; + [[group(0), binding(1)]] var texture0 : texture_2d; [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; diff --git a/src/tests/end2end/ComputeIndirectTests.cpp b/src/tests/end2end/ComputeIndirectTests.cpp index d75dbfbd56..2d8bf1977d 100644 --- a/src/tests/end2end/ComputeIndirectTests.cpp +++ b/src/tests/end2end/ComputeIndirectTests.cpp @@ -38,8 +38,8 @@ void ComputeIndirectTests::BasicTest(std::initializer_list bufferList, [[offset(0)]] workGroups : vec3; }; - [[set(0), binding(0)]] var input : InputBuf; - [[set(0), binding(1)]] var output : OutputBuf; + [[group(0), binding(0)]] var input : InputBuf; + [[group(0), binding(1)]] var output : OutputBuf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; diff --git a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp index 56ebfe9722..9ef4624891 100644 --- a/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp +++ b/src/tests/end2end/ComputeStorageBufferBarrierTests.cpp @@ -36,7 +36,7 @@ TEST_P(ComputeStorageBufferBarrierTests, AddIncrement) { [[offset(0)]] data : [[stride(4)]] array; }; - [[set(0), binding(0)]] var buf : [[access(read_write)]] Buf; + [[group(0), binding(0)]] var buf : [[access(read_write)]] Buf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; @@ -92,8 +92,8 @@ TEST_P(ComputeStorageBufferBarrierTests, AddPingPong) { [[offset(0)]] data : [[stride(4)]] array; }; - [[set(0), binding(0)]] var src : [[access(read_write)]] Src; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var src : [[access(read_write)]] Src; + [[group(0), binding(1)]] var dst : [[access(read_write)]] Dst; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; [[stage(compute)]] fn main() -> void { @@ -163,8 +163,8 @@ TEST_P(ComputeStorageBufferBarrierTests, StorageAndReadonlyStoragePingPongInOneP [[offset(0)]] data : [[stride(4)]] array; }; - [[set(0), binding(0)]] var src : [[access(read)]] Src; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var src : [[access(read)]] Src; + [[group(0), binding(1)]] var dst : [[access(read_write)]] Dst; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; @@ -232,8 +232,8 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPong) { [[offset(0)]] data : [[stride(16)]] array, 25>; }; - [[set(0), binding(0)]] var src : Buf; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Buf; + [[group(0), binding(0)]] var src : Buf; + [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; [[stage(compute)]] fn main() -> void { @@ -300,8 +300,8 @@ TEST_P(ComputeStorageBufferBarrierTests, UniformToStorageAddPingPongInOnePass) { [[offset(0)]] data : [[stride(16)]] array, 25>; }; - [[set(0), binding(0)]] var src : Buf; - [[set(0), binding(1)]] var dst : [[access(read_write)]] Buf; + [[group(0), binding(0)]] var src : Buf; + [[group(0), binding(1)]] var dst : [[access(read_write)]] Buf; [[builtin(global_invocation_id)]] var GlobalInvocationID : vec3; [[stage(compute)]] fn main() -> void { diff --git a/src/tests/end2end/CreateReadyPipelineTests.cpp b/src/tests/end2end/CreateReadyPipelineTests.cpp index f48fb7f20c..8e8ae0176a 100644 --- a/src/tests/end2end/CreateReadyPipelineTests.cpp +++ b/src/tests/end2end/CreateReadyPipelineTests.cpp @@ -38,7 +38,7 @@ TEST_P(CreateReadyPipelineTest, BasicUseOfCreateReadyComputePipeline) { [[block]] struct SSBO { [[offset(0)]] value : u32; }; - [[set(0), binding(0)]] var ssbo : SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() -> void { ssbo.value = 1u; @@ -105,7 +105,7 @@ TEST_P(CreateReadyPipelineTest, CreateComputePipelineFailed) { [[block]] struct SSBO { [[offset(0)]] value : u32; }; - [[set(0), binding(0)]] var ssbo : SSBO; + [[group(0), binding(0)]] var ssbo : SSBO; [[stage(compute)]] fn main() -> void { ssbo.value = 1u; diff --git a/src/tests/end2end/D3D12CachingTests.cpp b/src/tests/end2end/D3D12CachingTests.cpp index 39742a9678..c3619f6b3c 100644 --- a/src/tests/end2end/D3D12CachingTests.cpp +++ b/src/tests/end2end/D3D12CachingTests.cpp @@ -229,7 +229,7 @@ TEST_P(D3D12CachingTests, ReuseShaderWithMultipleEntryPoints) { [[block]] struct Data { [[offset(0)]] data : u32; }; - [[binding(0), set(0)]] var data : Data; + [[binding(0), group(0)]] var data : Data; [[stage(compute)]] fn write1() -> void { data.data = 1u; diff --git a/src/tests/end2end/DepthStencilCopyTests.cpp b/src/tests/end2end/DepthStencilCopyTests.cpp index be8d00e203..47d7ad0df6 100644 --- a/src/tests/end2end/DepthStencilCopyTests.cpp +++ b/src/tests/end2end/DepthStencilCopyTests.cpp @@ -253,7 +253,7 @@ class DepthStencilCopyTests : public DawnTest { // Sample the input texture and write out depth. |result| will only be set to 1 if we // pass the depth test. pipelineDescriptor.cFragmentStage.module = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var texture0 : texture_2d; + [[group(0), binding(0)]] var texture0 : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; [[location(0)]] var result : u32; diff --git a/src/tests/end2end/DepthStencilSamplingTests.cpp b/src/tests/end2end/DepthStencilSamplingTests.cpp index 35c2e7429d..c589a4f232 100644 --- a/src/tests/end2end/DepthStencilSamplingTests.cpp +++ b/src/tests/end2end/DepthStencilSamplingTests.cpp @@ -83,8 +83,9 @@ class DepthStencilSamplingTest : public DawnTest { for (TestAspect aspect : aspects) { switch (aspect) { case TestAspect::Depth: - shaderSource << "[[set(0), binding(" << index << ")]] var tex" - << index << " : texture_2d;\n"; + shaderSource << "[[group(0), binding(" << index + << ")]] var tex" << index + << " : texture_2d;\n"; shaderSource << "[[location(" << index << ")]] var result" << index << " : f32;\n"; @@ -94,8 +95,9 @@ class DepthStencilSamplingTest : public DawnTest { pipelineDescriptor.cColorStates[index].format = wgpu::TextureFormat::R32Float; break; case TestAspect::Stencil: - shaderSource << "[[set(0), binding(" << index << ")]] var tex" - << index << " : texture_2d;\n"; + shaderSource << "[[group(0), binding(" << index + << ")]] var tex" << index + << " : texture_2d;\n"; shaderSource << "[[location(" << index << ")]] var result" << index << " : u32;\n"; @@ -138,11 +140,11 @@ class DepthStencilSamplingTest : public DawnTest { for (TestAspect aspect : aspects) { switch (aspect) { case TestAspect::Depth: - shaderSource << "[[set(0), binding(" << 2 * index + shaderSource << "[[group(0), binding(" << 2 * index << ")]] var tex" << index << " : texture_2d;\n"; - shaderSource << "[[set(0), binding(" << 2 * index + 1 + shaderSource << "[[group(0), binding(" << 2 * index + 1 << ")]] var result" << index << " : DepthResult;\n"; @@ -150,11 +152,11 @@ class DepthStencilSamplingTest : public DawnTest { << ", vec2(0, 0), 0)[" << componentIndex << "];"; break; case TestAspect::Stencil: - shaderSource << "[[set(0), binding(" << 2 * index + shaderSource << "[[group(0), binding(" << 2 * index << ")]] var tex" << index << " : texture_2d;\n"; - shaderSource << "[[set(0), binding(" << 2 * index + 1 + shaderSource << "[[group(0), binding(" << 2 * index + 1 << ")]] var result" << index << " : StencilResult;\n"; @@ -186,12 +188,12 @@ class DepthStencilSamplingTest : public DawnTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var samp : sampler_comparison; - [[set(0), binding(1)]] var tex : texture_depth_2d; + [[group(0), binding(0)]] var samp : sampler_comparison; + [[group(0), binding(1)]] var tex : texture_depth_2d; [[block]] struct Uniforms { [[offset(0)]] compareRef : f32; }; - [[set(0), binding(2)]] var uniforms : Uniforms; + [[group(0), binding(2)]] var uniforms : Uniforms; [[location(0)]] var samplerResult : f32; @@ -218,17 +220,17 @@ class DepthStencilSamplingTest : public DawnTest { wgpu::ComputePipeline CreateComparisonComputePipeline() { wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var samp : sampler_comparison; - [[set(0), binding(1)]] var tex : texture_depth_2d; + [[group(0), binding(0)]] var samp : sampler_comparison; + [[group(0), binding(1)]] var tex : texture_depth_2d; [[block]] struct Uniforms { [[offset(0)]] compareRef : f32; }; - [[set(0), binding(2)]] var uniforms : Uniforms; + [[group(0), binding(2)]] var uniforms : Uniforms; [[block]] struct SamplerResult { [[offset(0)]] value : f32; }; - [[set(0), binding(3)]] var samplerResult : SamplerResult; + [[group(0), binding(3)]] var samplerResult : SamplerResult; [[stage(compute)]] fn main() -> void { samplerResult.value = textureSampleCompare(tex, samp, vec2(0.5, 0.5), uniforms.compareRef); diff --git a/src/tests/end2end/DepthStencilStateTests.cpp b/src/tests/end2end/DepthStencilStateTests.cpp index 1dee59ab4b..66fc3a6e14 100644 --- a/src/tests/end2end/DepthStencilStateTests.cpp +++ b/src/tests/end2end/DepthStencilStateTests.cpp @@ -57,7 +57,7 @@ class DepthStencilStateTest : public DawnTest { [[offset(0)]] color : vec3; [[offset(12)]] depth : f32; }; - [[set(0), binding(0)]] var ubo : UBO; + [[group(0), binding(0)]] var ubo : UBO; [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; @@ -77,7 +77,7 @@ class DepthStencilStateTest : public DawnTest { [[offset(0)]] color : vec3; [[offset(12)]] depth : f32; }; - [[set(0), binding(0)]] var ubo : UBO; + [[group(0), binding(0)]] var ubo : UBO; [[location(0)]] var fragColor : vec4; diff --git a/src/tests/end2end/DeviceLostTests.cpp b/src/tests/end2end/DeviceLostTests.cpp index d5370084d8..ca34617769 100644 --- a/src/tests/end2end/DeviceLostTests.cpp +++ b/src/tests/end2end/DeviceLostTests.cpp @@ -116,7 +116,7 @@ TEST_P(DeviceLostTest, GetBindGroupLayoutFails) { [[block]] struct UniformBuffer { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var ubo : UniformBuffer; + [[group(0), binding(0)]] var ubo : UniformBuffer; [[stage(compute)]] fn main() -> void { })"); diff --git a/src/tests/end2end/DynamicBufferOffsetTests.cpp b/src/tests/end2end/DynamicBufferOffsetTests.cpp index ad948361da..3eb70e132a 100644 --- a/src/tests/end2end/DynamicBufferOffsetTests.cpp +++ b/src/tests/end2end/DynamicBufferOffsetTests.cpp @@ -125,10 +125,10 @@ class DynamicBufferOffsetTests : public DawnTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var uBufferNotDynamic : Buffer1; - [[set(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; - [[set(0), binding(3)]] var uBuffer : Buffer3; - [[set(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; + [[group(0), binding(0)]] var uBufferNotDynamic : Buffer1; + [[group(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; + [[group(0), binding(3)]] var uBuffer : Buffer3; + [[group(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; )"; if (isInheritedPipeline) { @@ -137,7 +137,7 @@ class DynamicBufferOffsetTests : public DawnTest { [[offset(0)]] value : vec2; }; - [[set(1), binding(0)]] var paddingBlock : Buffer5; + [[group(1), binding(0)]] var paddingBlock : Buffer5; )"; } @@ -194,10 +194,10 @@ class DynamicBufferOffsetTests : public DawnTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var uBufferNotDynamic : Buffer1; - [[set(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; - [[set(0), binding(3)]] var uBuffer : Buffer3; - [[set(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; + [[group(0), binding(0)]] var uBufferNotDynamic : Buffer1; + [[group(0), binding(1)]] var sBufferNotDynamic : [[access(read_write)]] Buffer2; + [[group(0), binding(3)]] var uBuffer : Buffer3; + [[group(0), binding(4)]] var sBuffer : [[access(read_write)]] Buffer4; )"; if (isInheritedPipeline) { @@ -206,7 +206,7 @@ class DynamicBufferOffsetTests : public DawnTest { [[offset(0)]] value : vec2; }; - [[set(1), binding(0)]] var paddingBlock : Buffer5; + [[group(1), binding(0)]] var paddingBlock : Buffer5; )"; } diff --git a/src/tests/end2end/EntryPointTests.cpp b/src/tests/end2end/EntryPointTests.cpp index 776c2dcca8..202b784b5c 100644 --- a/src/tests/end2end/EntryPointTests.cpp +++ b/src/tests/end2end/EntryPointTests.cpp @@ -78,7 +78,7 @@ TEST_P(EntryPointTests, TwoComputeInModule) { [[block]] struct Data { [[offset(0)]] data : u32; }; - [[binding(0), set(0)]] var data : Data; + [[binding(0), group(0)]] var data : Data; [[stage(compute)]] fn write1() -> void { data.data = 1u; diff --git a/src/tests/end2end/GpuMemorySynchronizationTests.cpp b/src/tests/end2end/GpuMemorySynchronizationTests.cpp index 7740cb33f1..4db671c193 100644 --- a/src/tests/end2end/GpuMemorySynchronizationTests.cpp +++ b/src/tests/end2end/GpuMemorySynchronizationTests.cpp @@ -46,7 +46,7 @@ class GpuMemorySyncTests : public DawnTest { [[block]] struct Data { [[offset(0)]] a : i32; }; - [[set(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : [[access(read_write)]] Data; [[stage(compute)]] fn main() -> void { data.a = data.a + 1; })"); @@ -74,7 +74,7 @@ class GpuMemorySyncTests : public DawnTest { [[block]] struct Data { [[offset(0)]] i : i32; }; - [[set(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : [[access(read_write)]] Data; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { data.i = data.i + 1; @@ -262,7 +262,7 @@ class StorageToUniformSyncTests : public DawnTest { [[block]] struct Data { [[offset(0)]] a : f32; }; - [[set(0), binding(0)]] var data : [[access(read_write)]] Data; + [[group(0), binding(0)]] var data : [[access(read_write)]] Data; [[stage(compute)]] fn main() -> void { data.a = 1.0; })"); @@ -289,7 +289,7 @@ class StorageToUniformSyncTests : public DawnTest { [[block]] struct Contents { [[offset(0)]] color : f32; }; - [[set(0), binding(0)]] var contents : Contents; + [[group(0), binding(0)]] var contents : Contents; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { @@ -461,12 +461,12 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[block]] struct VBContents { [[offset(0)]] pos : [[stride(16)]] array, 4>; }; - [[set(0), binding(0)]] var vbContents : [[access(read_write)]] VBContents; + [[group(0), binding(0)]] var vbContents : [[access(read_write)]] VBContents; [[block]] struct IBContents { [[offset(0)]] indices : [[stride(16)]] array, 2>; }; - [[set(0), binding(1)]] var ibContents : [[access(read_write)]] IBContents; + [[group(0), binding(1)]] var ibContents : [[access(read_write)]] IBContents; // TODO(crbug.com/tint/386): Use the same struct. [[block]] struct ColorContents1 { @@ -475,8 +475,8 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[block]] struct ColorContents2 { [[offset(0)]] color : f32; }; - [[set(0), binding(2)]] var uniformContents : [[access(read_write)]] ColorContents1; - [[set(0), binding(3)]] var storageContents : [[access(read_write)]] ColorContents2; + [[group(0), binding(2)]] var uniformContents : [[access(read_write)]] ColorContents1; + [[group(0), binding(3)]] var storageContents : [[access(read_write)]] ColorContents2; [[stage(compute)]] fn main() -> void { vbContents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); @@ -530,8 +530,8 @@ TEST_P(MultipleWriteThenMultipleReadTests, SeparateBuffers) { [[offset(0)]] color : f32; }; - [[set(0), binding(0)]] var uniformBuffer : Buf; - [[set(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; + [[group(0), binding(0)]] var uniformBuffer : Buf; + [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { @@ -588,7 +588,7 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { [[offset(768)]] color1 : f32; }; - [[set(0), binding(0)]] var contents : [[access(read_write)]] Contents; + [[group(0), binding(0)]] var contents : [[access(read_write)]] Contents; [[stage(compute)]] fn main() -> void { contents.pos[0] = vec4(-1.0, 1.0, 0.0, 1.0); @@ -642,8 +642,8 @@ TEST_P(MultipleWriteThenMultipleReadTests, OneBuffer) { [[block]] struct Buf { [[offset(0)]] color : f32; }; - [[set(0), binding(0)]] var uniformBuffer : Buf; - [[set(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; + [[group(0), binding(0)]] var uniformBuffer : Buf; + [[group(0), binding(1)]] var storageBuffer : [[access(read)]] Buf; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { diff --git a/src/tests/end2end/IOSurfaceWrappingTests.cpp b/src/tests/end2end/IOSurfaceWrappingTests.cpp index 5fb8133d30..c2c1b72351 100644 --- a/src/tests/end2end/IOSurfaceWrappingTests.cpp +++ b/src/tests/end2end/IOSurfaceWrappingTests.cpp @@ -274,8 +274,8 @@ class IOSurfaceUsageTests : public IOSurfaceTestBase { } )"); wgpu::ShaderModule fs = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var sampler0 : sampler; - [[set(0), binding(1)]] var texture0 : texture_2d; + [[group(0), binding(0)]] var sampler0 : sampler; + [[group(0), binding(1)]] var texture0 : texture_2d; [[location(0)]] var texCoord : vec2; [[location(0)]] var fragColor : vec4; diff --git a/src/tests/end2end/MultisampledSamplingTests.cpp b/src/tests/end2end/MultisampledSamplingTests.cpp index aeed4eef06..0ab3dd4fe4 100644 --- a/src/tests/end2end/MultisampledSamplingTests.cpp +++ b/src/tests/end2end/MultisampledSamplingTests.cpp @@ -90,14 +90,14 @@ class MultisampledSamplingTest : public DawnTest { wgpu::ComputePipelineDescriptor desc = {}; desc.computeStage.entryPoint = "main"; desc.computeStage.module = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var texture0 : texture_multisampled_2d; - [[set(0), binding(1)]] var texture1 : texture_multisampled_2d; + [[group(0), binding(0)]] var texture0 : texture_multisampled_2d; + [[group(0), binding(1)]] var texture1 : texture_multisampled_2d; [[block]] struct Results { [[offset(0)]] colorSamples : [[stride(4)]] array; [[offset(16)]] depthSamples : [[stride(4)]] array; }; - [[set(0), binding(2)]] var results : [[access(read_write)]] Results; + [[group(0), binding(2)]] var results : [[access(read_write)]] Results; [[stage(compute)]] fn main() -> void { 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 a53a0b3d1d..2f9a8d3bcf 100644 --- a/src/tests/end2end/OpArrayLengthTests.cpp +++ b/src/tests/end2end/OpArrayLengthTests.cpp @@ -66,10 +66,10 @@ class OpArrayLengthTest : public DawnTest { }; // The length should be 1 because the buffer is 4-byte long. - [[set(0), binding(0)]] var buffer1 : [[access(read)]] DataBuffer1; + [[group(0), binding(0)]] var buffer1 : [[access(read)]] DataBuffer1; // The length should be 64 because the buffer is 256 bytes long. - [[set(0), binding(1)]] var buffer2 : [[access(read)]] DataBuffer2; + [[group(0), binding(1)]] var buffer2 : [[access(read)]] DataBuffer2; // The length should be (512 - 16*4) / 8 = 56 because the buffer is 512 bytes long // and the structure is 8 bytes big. @@ -82,7 +82,7 @@ class OpArrayLengthTest : public DawnTest { [[offset(0)]] garbage : mat4x4; [[offset(64)]] data : [[stride(8)]] array; }; - [[set(0), binding(2)]] var buffer3 : [[access(read)]] Buffer3; + [[group(0), binding(2)]] var buffer3 : [[access(read)]] Buffer3; )"; // See comments in the shader for an explanation of these values @@ -132,7 +132,7 @@ TEST_P(OpArrayLengthTest, Compute) { [[block]] struct ResultBuffer { [[offset(0)]] data : [[stride(4)]] array; }; - [[set(1), binding(0)]] var result : [[access(read_write)]] ResultBuffer; + [[group(1), binding(0)]] var result : [[access(read_write)]] ResultBuffer; )" + mShaderInterface + R"( [[stage(compute)]] fn main() -> void { result.data[0] = arrayLength(buffer1.data); diff --git a/src/tests/end2end/RenderBundleTests.cpp b/src/tests/end2end/RenderBundleTests.cpp index 90c18235ea..55535629ae 100644 --- a/src/tests/end2end/RenderBundleTests.cpp +++ b/src/tests/end2end/RenderBundleTests.cpp @@ -43,7 +43,7 @@ class RenderBundleTest : public DawnTest { [[block]] struct Ubo { [[offset(0)]] color : vec4; }; - [[set(0), binding(0)]] var fragmentUniformBuffer : Ubo; + [[group(0), binding(0)]] var fragmentUniformBuffer : Ubo; [[stage(fragment)]] fn main() -> void { fragColor = fragmentUniformBuffer.color; diff --git a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp index 4ffbe559e2..e94ddb2c36 100644 --- a/src/tests/end2end/SamplerFilterAnisotropicTests.cpp +++ b/src/tests/end2end/SamplerFilterAnisotropicTests.cpp @@ -45,7 +45,7 @@ class SamplerFilterAnisotropicTest : public DawnTest { [[location(0)]] var position : vec4; [[location(1)]] var uv : vec2; - [[set(0), binding(2)]] var uniforms : Uniforms; + [[group(0), binding(2)]] var uniforms : Uniforms; [[builtin(position)]] var Position : vec4; [[location(0)]] var fragUV : vec2; @@ -56,8 +56,8 @@ class SamplerFilterAnisotropicTest : public DawnTest { } )"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var sampler0 : sampler; - [[set(0), binding(1)]] var texture0 : texture_2d; + [[group(0), binding(0)]] var sampler0 : sampler; + [[group(0), binding(1)]] var texture0 : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; diff --git a/src/tests/end2end/SamplerTests.cpp b/src/tests/end2end/SamplerTests.cpp index d652c15526..bb7f7e6354 100644 --- a/src/tests/end2end/SamplerTests.cpp +++ b/src/tests/end2end/SamplerTests.cpp @@ -70,8 +70,8 @@ class SamplerTest : public DawnTest { } )"); auto fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var sampler0 : sampler; - [[set(0), binding(1)]] var texture0 : texture_2d; + [[group(0), binding(0)]] var sampler0 : sampler; + [[group(0), binding(1)]] var texture0 : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; diff --git a/src/tests/end2end/StorageTextureTests.cpp b/src/tests/end2end/StorageTextureTests.cpp index 9ca549417f..ca03cae165 100644 --- a/src/tests/end2end/StorageTextureTests.cpp +++ b/src/tests/end2end/StorageTextureTests.cpp @@ -165,7 +165,7 @@ class StorageTextureTests : public DawnTest { bool is2DArray, uint32_t binding) { std::ostringstream ostream; - ostream << "[[set(0), binding(" << binding << ")]] " + ostream << "[[group(0), binding(" << binding << ")]] " << "var storageImage" << binding << " : " << "[[access(" << accessQualifier << ")]] " << "texture_storage_2d"; @@ -712,7 +712,7 @@ TEST_P(StorageTextureTests, ReadonlyStorageTextureInComputeShader) { [[offset(0)]] result : u32; }; -[[set(0), binding(1)]] var dstBuffer : DstBuffer; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )" << CommonReadOnlyTestCode(format) << R"( [[stage(compute)]] fn main() -> void { @@ -917,7 +917,7 @@ TEST_P(StorageTextureTests, Readonly2DArrayStorageTexture) { [[offset(0)]] result : u32; }; -[[set(0), binding(1)]] var dstBuffer : DstBuffer; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )" << CommonReadOnlyTestCode(kTextureFormat, true) << R"( [[stage(compute)]] fn main() -> void { @@ -964,8 +964,8 @@ TEST_P(StorageTextureTests, ReadonlyAndWriteonlyStorageTexturePingPong) { kTextureFormat, wgpu::TextureUsage::Storage | wgpu::TextureUsage::CopySrc, 1u, 1u); wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"( -[[set(0), binding(0)]] var Src : [[access(read)]] texture_storage_2d; -[[set(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; +[[group(0), binding(0)]] var Src : [[access(read)]] texture_storage_2d; +[[group(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; [[stage(compute)]] fn main() -> void { var srcValue : vec4 = textureLoad(Src, vec2(0, 0)); srcValue.x = srcValue.x + 1u; @@ -1040,8 +1040,8 @@ TEST_P(StorageTextureTests, SampledAndWriteonlyStorageTexturePingPong) { wgpu::Texture storageTexture2 = CreateTexture( kTextureFormat, wgpu::TextureUsage::Sampled | wgpu::TextureUsage::Storage, 1u, 1u); wgpu::ShaderModule module = utils::CreateShaderModuleFromWGSL(device, R"( -[[set(0), binding(0)]] var Src : texture_2d; -[[set(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; +[[group(0), binding(0)]] var Src : texture_2d; +[[group(0), binding(1)]] var Dst : [[access(write)]] texture_storage_2d; [[stage(compute)]] fn main() -> void { var srcValue : vec4 = textureLoad(Src, vec2(0, 0)); srcValue.x = srcValue.x + 1u; @@ -1139,13 +1139,13 @@ fn doTest() -> bool { })"; const char* kCommonWriteOnlyZeroInitTestCodeFragment = R"( -[[set(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; +[[group(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; [[stage(fragment)]] fn main() -> void { textureStore(dstImage, vec2(0, 0), vec4(1u, 0u, 0u, 1u)); })"; const char* kCommonWriteOnlyZeroInitTestCodeCompute = R"( -[[set(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; +[[group(0), binding(0)]] var dstImage : [[access(write)]] texture_storage_2d; [[stage(compute)]] fn main() -> void { textureStore(dstImage, vec2(0, 0), vec4(1u, 0u, 0u, 1u)); @@ -1162,7 +1162,7 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInRenderPa // green as the output color, otherwise uses red instead. const char* kVertexShader = kSimpleVertexShader; const std::string kFragmentShader = std::string(R"( -[[set(0), binding(0)]] var srcImage : [[access(read)]] texture_storage_2d; +[[group(0), binding(0)]] var srcImage : [[access(read)]] texture_storage_2d; [[location(0)]] var o_color : vec4; )") + kCommonReadOnlyZeroInitTestCode + R"( @@ -1189,8 +1189,8 @@ TEST_P(StorageTextureZeroInitTests, ReadonlyStorageTextureClearsToZeroInComputeP [[offset(0)]] result : u32; }; -[[set(0), binding(0)]] var srcImage : [[access(read)]] texture_storage_2d; -[[set(0), binding(1)]] var dstBuffer : DstBuffer; +[[group(0), binding(0)]] var srcImage : [[access(read)]] texture_storage_2d; +[[group(0), binding(1)]] var dstBuffer : DstBuffer; )") + kCommonReadOnlyZeroInitTestCode + R"( [[stage(compute)]] fn main() -> void { if (doTest()) { diff --git a/src/tests/end2end/TextureFormatTests.cpp b/src/tests/end2end/TextureFormatTests.cpp index 8cb1055ce1..4dacc82582 100644 --- a/src/tests/end2end/TextureFormatTests.cpp +++ b/src/tests/end2end/TextureFormatTests.cpp @@ -163,7 +163,7 @@ class TextureFormatTest : public DawnTest { const char* type = utils::GetColorTextureComponentWGSLType(sampleFormatInfo.format); std::ostringstream fsSource; - fsSource << "[[set(0), binding(0)]] var myTexture : texture_2d<" << type + fsSource << "[[group(0), binding(0)]] var myTexture : texture_2d<" << type << ">;\n"; fsSource << "[[builtin(frag_coord)]] var FragCoord : vec4;\n"; fsSource << "[[location(0)]] var fragColor : vec4<" << type << ">;\n"; diff --git a/src/tests/end2end/TextureSubresourceTests.cpp b/src/tests/end2end/TextureSubresourceTests.cpp index 337d14f621..e58df56595 100644 --- a/src/tests/end2end/TextureSubresourceTests.cpp +++ b/src/tests/end2end/TextureSubresourceTests.cpp @@ -106,8 +106,8 @@ class TextureSubresourceTest : public DawnTest { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var samp : sampler; - [[set(0), binding(1)]] var tex : texture_2d; + [[group(0), binding(0)]] var samp : sampler; + [[group(0), binding(1)]] var tex : texture_2d; [[builtin(frag_coord)]] var FragCoord : vec4; diff --git a/src/tests/perf_tests/SubresourceTrackingPerf.cpp b/src/tests/perf_tests/SubresourceTrackingPerf.cpp index 8be7e4b097..8e82d15f3a 100644 --- a/src/tests/perf_tests/SubresourceTrackingPerf.cpp +++ b/src/tests/perf_tests/SubresourceTrackingPerf.cpp @@ -78,7 +78,7 @@ class SubresourceTrackingPerf : public DawnPerfTestWithParams FragColor : vec4; - [[set(0), binding(0)]] var materials : texture_sampled_2d; + [[group(0), binding(0)]] var materials : texture_sampled_2d; [[stage(fragment)]] fn main() -> void { FragColor = vec4(1.0, 0.0, 0.0, 1.0); } diff --git a/src/tests/unittests/validation/BindGroupValidationTests.cpp b/src/tests/unittests/validation/BindGroupValidationTests.cpp index 99ba07cb85..6245dcf633 100644 --- a/src/tests/unittests/validation/BindGroupValidationTests.cpp +++ b/src/tests/unittests/validation/BindGroupValidationTests.cpp @@ -1094,10 +1094,10 @@ class SetBindGroupValidationTest : public ValidationTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var uBufferDynamic : S; - [[set(0), binding(1)]] var uBuffer : S; - [[set(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; - [[set(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[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; [[stage(fragment)]] fn main() -> void { })"); @@ -1117,10 +1117,10 @@ class SetBindGroupValidationTest : public ValidationTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var uBufferDynamic : S; - [[set(0), binding(1)]] var uBuffer : S; - [[set(0), binding(2)]] var sBufferDynamic : [[access(read_write)]] S; - [[set(0), binding(3)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[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; [[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void { })"); @@ -1542,7 +1542,7 @@ class SetBindGroupPersistenceValidationTest : public ValidationTest { for (uint32_t b = 0; b < layout.size(); ++b) { wgpu::BufferBindingType binding = layout[b]; - ss << "[[set(" << l << "), binding(" << b << ")]] "; + ss << "[[group(" << l << "), binding(" << b << ")]] "; switch (binding) { case wgpu::BufferBindingType::Storage: ss << "var set" << l << "_binding" << b @@ -1713,8 +1713,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; - [[set(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; + [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; [[stage(fragment)]] fn main() -> void { })", @@ -1746,8 +1746,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest { [[offset(0)]] value : vec2; }; - [[set(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; - [[set(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; + [[group(0), binding(0)]] var sBufferDynamic : [[access(read_write)]] S; + [[group(1), binding(0)]] var sReadonlyBufferDynamic : [[access(read)]] S; [[stage(compute), workgroup_size(4, 4, 1)]] fn main() -> void { })", @@ -1789,11 +1789,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, ROStorageInBGLWithRWStorageInShader) { TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) { constexpr char kTexture2DShaderFS[] = R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"; constexpr char kTexture2DShaderCS[] = R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(compute)]] fn main() -> void { })"; @@ -1826,11 +1826,11 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) { wgpu::TextureViewDimension::e2DArray}})})); constexpr char kTexture2DArrayShaderFS[] = R"( - [[set(0), binding(0)]] var myTexture : texture_2d_array; + [[group(0), binding(0)]] var myTexture : texture_2d_array; [[stage(fragment)]] fn main() -> void { })"; constexpr char kTexture2DArrayShaderCS[] = R"( - [[set(0), binding(0)]] var myTexture : texture_2d_array; + [[group(0), binding(0)]] var myTexture : texture_2d_array; [[stage(compute)]] fn main() -> void { })"; @@ -2079,7 +2079,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Filtering}}); CreateFragmentPipeline(&bindGroupLayout, R"( - [[set(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(0)]] var mySampler: sampler; [[stage(fragment)]] fn main() -> void { })"); } @@ -2090,7 +2090,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Comparison}}); CreateFragmentPipeline(&bindGroupLayout, R"( - [[set(0), binding(0)]] var mySampler: sampler_comparison; + [[group(0), binding(0)]] var mySampler: sampler_comparison; [[stage(fragment)]] fn main() -> void { })"); } @@ -2101,7 +2101,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Filtering}}); ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"( - [[set(0), binding(0)]] var mySampler: sampler_comparison; + [[group(0), binding(0)]] var mySampler: sampler_comparison; [[stage(fragment)]] fn main() -> void { })")); } @@ -2112,7 +2112,7 @@ TEST_F(ComparisonSamplerBindingTest, DISABLED_ShaderAndBGLMatches) { device, {{0, wgpu::ShaderStage::Fragment, wgpu::SamplerBindingType::Comparison}}); ASSERT_DEVICE_ERROR(CreateFragmentPipeline(&bindGroupLayout, R"( - [[set(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(0)]] var mySampler: sampler; [[stage(fragment)]] fn main() -> void { })")); } diff --git a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp index 2dbd5ee281..dff2b7d411 100644 --- a/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp +++ b/src/tests/unittests/validation/GetBindGroupLayoutValidationTests.cpp @@ -42,8 +42,8 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniform0 : S; - [[set(1), binding(0)]] var uniform1 : S; + [[group(0), binding(0)]] var uniform0 : S; + [[group(1), binding(0)]] var uniform1 : S; [[stage(vertex)]] fn main() -> void { })"); @@ -52,12 +52,12 @@ TEST_F(GetBindGroupLayoutTests, SameObject) { [[block]] struct S2 { [[offset(0)]] pos : vec4; }; - [[set(2), binding(0)]] var uniform2 : S2; + [[group(2), binding(0)]] var uniform2 : S2; [[block]] struct S3 { [[offset(0)]] pos : mat4x4; }; - [[set(3), binding(0)]] var storage3 : S3; + [[group(3), binding(0)]] var storage3 : S3; [[stage(fragment)]] fn main() -> void { })"); @@ -90,7 +90,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -128,7 +128,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(compute)]] fn main() -> void { })"); @@ -174,7 +174,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var ssbo : S; + [[group(0), binding(0)]] var ssbo : S; [[stage(fragment)]] fn main() -> void { })"); @@ -186,7 +186,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -199,7 +199,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var ssbo : [[access(read)]] S; + [[group(0), binding(0)]] var ssbo : [[access(read)]] S; [[stage(fragment)]] fn main() -> void { })"); @@ -211,7 +211,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { { binding.texture.sampleType = wgpu::TextureSampleType::Float; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -221,7 +221,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { { binding.texture.multisampled = true; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_multisampled_2d; + [[group(0), binding(0)]] var myTexture : texture_multisampled_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -232,7 +232,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) { { binding.sampler.type = wgpu::SamplerBindingType::Filtering; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(0)]] var mySampler: sampler; [[stage(fragment)]] fn main() -> void { })"); @@ -254,7 +254,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::e1D; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_1d; + [[group(0), binding(0)]] var myTexture : texture_1d; [[stage(fragment)]] fn main() -> void { })"); @@ -264,7 +264,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::e2D; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -274,7 +274,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::e2DArray; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d_array; + [[group(0), binding(0)]] var myTexture : texture_2d_array; [[stage(fragment)]] fn main() -> void { })"); @@ -284,7 +284,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::e3D; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_3d; + [[group(0), binding(0)]] var myTexture : texture_3d; [[stage(fragment)]] fn main() -> void { })"); @@ -294,7 +294,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::Cube; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_cube; + [[group(0), binding(0)]] var myTexture : texture_cube; [[stage(fragment)]] fn main() -> void { })"); @@ -304,7 +304,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) { { binding.texture.viewDimension = wgpu::TextureViewDimension::CubeArray; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_cube_array; + [[group(0), binding(0)]] var myTexture : texture_cube_array; [[stage(fragment)]] fn main() -> void { })"); @@ -325,7 +325,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { { binding.texture.sampleType = wgpu::TextureSampleType::Float; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -335,7 +335,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { { binding.texture.sampleType = wgpu::TextureSampleType::Sint; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -345,7 +345,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) { { binding.texture.sampleType = wgpu::TextureSampleType::Uint; wgpu::RenderPipeline pipeline = RenderPipelineFromFragmentShader(R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -371,7 +371,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -384,7 +384,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(1)]] var uniforms : S; + [[group(0), binding(1)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -397,7 +397,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(1)]] var uniforms : S; + [[group(0), binding(1)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -411,8 +411,8 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniform0 : S; - [[set(1), binding(0)]] var uniform1 : S; + [[group(0), binding(0)]] var uniform0 : S; + [[group(1), binding(0)]] var uniform1 : S; [[stage(vertex)]] fn main() -> void { })"); @@ -421,7 +421,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(1), binding(0)]] var uniforms : S; + [[group(1), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -440,7 +440,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { [[block]] struct S { [[offset(0)]] pos : f32; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(vertex)]] fn main() -> void { })"); @@ -449,7 +449,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { [[block]] struct S { [[offset(0)]] pos : mat4x4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(vertex)]] fn main() -> void { })"); @@ -458,7 +458,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { [[block]] struct S { [[offset(0)]] pos : f32; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -467,7 +467,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) { [[block]] struct S { [[offset(0)]] pos : mat4x4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(fragment)]] fn main() -> void { })"); @@ -522,7 +522,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { })"); wgpu::ShaderModule vsModuleSampler = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(0)]] var mySampler: sampler; [[stage(vertex)]] fn main() -> void { })"); @@ -531,7 +531,7 @@ TEST_F(GetBindGroupLayoutTests, StageAggregation) { })"); wgpu::ShaderModule fsModuleSampler = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var mySampler: sampler; + [[group(0), binding(0)]] var mySampler: sampler; [[stage(fragment)]] fn main() -> void { })"); @@ -584,7 +584,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var ubo : S; + [[group(0), binding(0)]] var ubo : S; [[stage(vertex)]] fn main() -> void { })"); @@ -593,7 +593,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var ssbo : S; + [[group(0), binding(0)]] var ssbo : S; [[stage(fragment)]] fn main() -> void { })"); @@ -609,13 +609,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) { // Test it is invalid to have conflicting binding texture multisampling in the shaders. TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) { wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(vertex)]] fn main() -> void { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_multisampled_2d; + [[group(0), binding(0)]] var myTexture : texture_multisampled_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -631,13 +631,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) { // Test it is invalid to have conflicting binding texture dimension in the shaders. TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) { wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(vertex)]] fn main() -> void { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_3d; + [[group(0), binding(0)]] var myTexture : texture_3d; [[stage(fragment)]] fn main() -> void { })"); @@ -653,13 +653,13 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) { // Test it is invalid to have conflicting binding texture component type in the shaders. TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) { wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(vertex)]] fn main() -> void { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var myTexture : texture_2d; + [[group(0), binding(0)]] var myTexture : texture_2d; [[stage(fragment)]] fn main() -> void { })"); @@ -691,8 +691,8 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms0 : S; - [[set(2), binding(0)]] var uniforms2 : S; + [[group(0), binding(0)]] var uniforms0 : S; + [[group(2), binding(0)]] var uniforms2 : S; [[stage(fragment)]] fn main() -> void { })"); @@ -733,7 +733,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) { [[block]] struct S { [[offset(0)]] pos : vec4; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(vertex)]] fn main() -> void { })"); diff --git a/src/tests/unittests/validation/RenderBundleValidationTests.cpp b/src/tests/unittests/validation/RenderBundleValidationTests.cpp index 54a60e82a5..5490a154a3 100644 --- a/src/tests/unittests/validation/RenderBundleValidationTests.cpp +++ b/src/tests/unittests/validation/RenderBundleValidationTests.cpp @@ -33,7 +33,7 @@ namespace { [[block]] struct S { [[offset(0)]] transform : mat2x2; }; - [[set(0), binding(0)]] var uniforms : S; + [[group(0), binding(0)]] var uniforms : S; [[stage(vertex)]] fn main() -> void { })"); @@ -42,12 +42,12 @@ namespace { [[block]] struct Uniforms { [[offset(0)]] color : vec4; }; - [[set(1), binding(0)]] var uniforms : Uniforms; + [[group(1), binding(0)]] var uniforms : Uniforms; [[block]] struct Storage { [[offset(0)]] dummy : [[stride(4)]] array; }; - [[set(1), binding(1)]] var ssbo : [[access(read_write)]] Storage; + [[group(1), binding(1)]] var ssbo : [[access(read_write)]] Storage; [[stage(fragment)]] fn main() -> void { })"); diff --git a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp index aa3f7d577f..3637673e9e 100644 --- a/src/tests/unittests/validation/RenderPipelineValidationTests.cpp +++ b/src/tests/unittests/validation/RenderPipelineValidationTests.cpp @@ -397,7 +397,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) { std::ostringstream stream; stream << R"( - [[set(0), binding(0)]] var myTexture : texture_2d<)" + [[group(0), binding(0)]] var myTexture : texture_2d<)" << kScalarTypes[i] << R"(>; [[stage(fragment)]] fn main() -> void { @@ -446,7 +446,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) { std::ostringstream stream; stream << R"( - [[set(0), binding(0)]] var myTexture : )" + [[group(0), binding(0)]] var myTexture : )" << kTextureKeywords[i] << R"(; [[stage(fragment)]] fn main() -> void { })"; @@ -474,7 +474,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) { [[block]] struct Dst { [[offset(0)]] data : [[stride(4)]] array; }; - [[set(0), binding(0)]] var dst : [[access(read_write)]] Dst; + [[group(0), binding(0)]] var dst : [[access(read_write)]] Dst; [[builtin(vertex_idx)]] var VertexIndex : u32; [[stage(vertex)]] fn main() -> void { dst.data[VertexIndex] = 0x1234u; diff --git a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp index 3b01ca61cc..a11be964a5 100644 --- a/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp +++ b/src/tests/unittests/validation/ResourceUsageTrackingTests.cpp @@ -779,7 +779,7 @@ namespace { [[block]] struct RBuffer { [[offset(0)]] value : f32; }; - [[set(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; + [[group(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; [[stage(fragment)]] fn main() -> void { })"); utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); @@ -819,7 +819,7 @@ namespace { [[block]] struct RBuffer { [[offset(0)]] value : f32; }; - [[set(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; + [[group(0), binding(0)]] var rBuffer : [[access(read)]] RBuffer; [[stage(compute)]] fn main() -> void { })"); wgpu::ComputePipelineDescriptor pipelineDescriptor; @@ -1554,7 +1554,7 @@ namespace { })"); wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; + [[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; [[stage(fragment)]] fn main() -> void { })"); utils::ComboRenderPipelineDescriptor pipelineDescriptor(device); @@ -1580,7 +1580,7 @@ namespace { { // Create a passthrough compute pipeline with a readonly storage texture wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; + [[group(0), binding(0)]] var tex : [[access(read)]] texture_storage_2d; [[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 838ae8ddd9..11a9b0e2a2 100644 --- a/src/tests/unittests/validation/StorageTextureValidationTests.cpp +++ b/src/tests/unittests/validation/StorageTextureValidationTests.cpp @@ -125,7 +125,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { // Readonly storage texture can be declared in a vertex shader. { wgpu::ShaderModule vsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; + [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; [[builtin(vertex_idx)]] var VertexIndex : u32; [[builtin(position)]] var Position : vec4; [[stage(vertex)]] fn main() -> void { @@ -142,7 +142,7 @@ TEST_F(StorageTextureValidationTests, RenderPipeline) { // Read-only storage textures can be declared in a fragment shader. { wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; + [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; [[builtin(frag_coord)]] var FragCoord : vec4; [[location(0)]] var fragColor : vec4; [[stage(fragment)]] fn main() -> void { @@ -197,13 +197,13 @@ TEST_F(StorageTextureValidationTests, ComputePipeline) { // Read-only storage textures can be declared in a compute shader. { wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"( - [[set(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; + [[group(0), binding(0)]] var image0 : [[access(read)]] texture_storage_2d; [[builtin(local_invocation_id)]] var LocalInvocationID : vec3; [[block]] struct Buf { [[offset(0)]] data : f32; }; - [[set(0), binding(1)]] var buf : [[access(read_write)]] Buf; + [[group(0), binding(1)]] var buf : [[access(read_write)]] Buf; [[stage(compute)]] fn main() -> void { buf.data = textureLoad(image0, vec2(LocalInvocationID.xy)).x;