Update Dawn tests to use group instead of set.

This Cl updates the WGSL used by Dawn to use the new `group` decoration
instead of the deprecated `set` decoration.

Change-Id: I145aaff7721dfafff986ddc429c9cdc9389c2110
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/38141
Auto-Submit: dan sinclair <dsinclair@chromium.org>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Ben Clayton <bclayton@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
dan sinclair
2021-01-19 14:18:51 +00:00
committed by Commit Bot service account
parent e45593cb08
commit 0f9c2d7b78
35 changed files with 214 additions and 212 deletions

View File

@@ -1094,10 +1094,10 @@ class SetBindGroupValidationTest : public ValidationTest {
[[offset(0)]] value : vec2<f32>;
};
[[set(0), binding(0)]] var<uniform> uBufferDynamic : S;
[[set(0), binding(1)]] var<uniform> uBuffer : S;
[[set(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[set(0), binding(3)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[group(0), binding(0)]] var<uniform> uBufferDynamic : S;
[[group(0), binding(1)]] var<uniform> uBuffer : S;
[[group(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[group(0), binding(3)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -1117,10 +1117,10 @@ class SetBindGroupValidationTest : public ValidationTest {
[[offset(0)]] value : vec2<f32>;
};
[[set(0), binding(0)]] var<uniform> uBufferDynamic : S;
[[set(0), binding(1)]] var<uniform> uBuffer : S;
[[set(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[set(0), binding(3)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[group(0), binding(0)]] var<uniform> uBufferDynamic : S;
[[group(0), binding(1)]] var<uniform> uBuffer : S;
[[group(0), binding(2)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[group(0), binding(3)]] var<storage_buffer> 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<storage_buffer> set" << l << "_binding" << b
@@ -1713,8 +1713,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
[[offset(0)]] value : vec2<f32>;
};
[[set(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[set(1), binding(0)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[group(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[group(1), binding(0)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[stage(fragment)]] fn main() -> void {
})",
@@ -1746,8 +1746,8 @@ class BindGroupLayoutCompatibilityTest : public ValidationTest {
[[offset(0)]] value : vec2<f32>;
};
[[set(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[set(1), binding(0)]] var<storage_buffer> sReadonlyBufferDynamic : [[access(read)]] S;
[[group(0), binding(0)]] var<storage_buffer> sBufferDynamic : [[access(read_write)]] S;
[[group(1), binding(0)]] var<storage_buffer> 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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() -> void {
})";
constexpr char kTexture2DShaderCS[] = R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[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<uniform_constant> myTexture : texture_2d_array<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() -> void {
})";
constexpr char kTexture2DArrayShaderCS[] = R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_2d_array<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d_array<f32>;
[[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<uniform_constant> mySampler: sampler;
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> mySampler: sampler_comparison;
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> mySampler: sampler_comparison;
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> mySampler: sampler;
[[group(0), binding(0)]] var<uniform_constant> mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
})"));
}

View File

@@ -42,8 +42,8 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniform0 : S;
[[set(1), binding(0)]] var<uniform> uniform1 : S;
[[group(0), binding(0)]] var<uniform> uniform0 : S;
[[group(1), binding(0)]] var<uniform> uniform1 : S;
[[stage(vertex)]] fn main() -> void {
})");
@@ -52,12 +52,12 @@ TEST_F(GetBindGroupLayoutTests, SameObject) {
[[block]] struct S2 {
[[offset(0)]] pos : vec4<f32>;
};
[[set(2), binding(0)]] var<uniform> uniform2 : S2;
[[group(2), binding(0)]] var<uniform> uniform2 : S2;
[[block]] struct S3 {
[[offset(0)]] pos : mat4x4<f32>;
};
[[set(3), binding(0)]] var<storage_buffer> storage3 : S3;
[[group(3), binding(0)]] var<storage_buffer> storage3 : S3;
[[stage(fragment)]] fn main() -> void {
})");
@@ -90,7 +90,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultShaderStageAndDynamicOffsets) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -128,7 +128,7 @@ TEST_F(GetBindGroupLayoutTests, ComputePipeline) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(compute)]] fn main() -> void {
})");
@@ -174,7 +174,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<storage_buffer> ssbo : S;
[[group(0), binding(0)]] var<storage_buffer> ssbo : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -186,7 +186,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -199,7 +199,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<storage_buffer> ssbo : [[access(read)]] S;
[[group(0), binding(0)]] var<storage_buffer> 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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[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<uniform_constant> myTexture : texture_multisampled_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_multisampled_2d<f32>;
[[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<uniform_constant> mySampler: sampler;
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> myTexture : texture_1d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_1d<f32>;
[[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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[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<uniform_constant> myTexture : texture_2d_array<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d_array<f32>;
[[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<uniform_constant> myTexture : texture_3d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_3d<f32>;
[[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<uniform_constant> myTexture : texture_cube<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_cube<f32>;
[[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<uniform_constant> myTexture : texture_cube_array<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_cube_array<f32>;
[[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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[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<uniform_constant> myTexture : texture_2d<i32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<i32>;
[[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<uniform_constant> myTexture : texture_2d<u32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<u32>;
[[stage(fragment)]] fn main() -> void {
})");
@@ -371,7 +371,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -384,7 +384,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(1)]] var<uniform> uniforms : S;
[[group(0), binding(1)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -397,7 +397,7 @@ TEST_F(GetBindGroupLayoutTests, BindingIndices) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(1)]] var<uniform> uniforms : S;
[[group(0), binding(1)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -411,8 +411,8 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniform0 : S;
[[set(1), binding(0)]] var<uniform> uniform1 : S;
[[group(0), binding(0)]] var<uniform> uniform0 : S;
[[group(1), binding(0)]] var<uniform> uniform1 : S;
[[stage(vertex)]] fn main() -> void {
})");
@@ -421,7 +421,7 @@ TEST_F(GetBindGroupLayoutTests, DuplicateBinding) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(1), binding(0)]] var<uniform> uniforms : S;
[[group(1), binding(0)]] var<uniform> 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<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
})");
@@ -449,7 +449,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
[[block]] struct S {
[[offset(0)]] pos : mat4x4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> 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<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -467,7 +467,7 @@ TEST_F(GetBindGroupLayoutTests, MinBufferSize) {
[[block]] struct S {
[[offset(0)]] pos : mat4x4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> 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<uniform_constant> mySampler: sampler;
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> mySampler: sampler;
[[group(0), binding(0)]] var<uniform_constant> mySampler: sampler;
[[stage(fragment)]] fn main() -> void {
})");
@@ -584,7 +584,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> ubo : S;
[[group(0), binding(0)]] var<uniform> ubo : S;
[[stage(vertex)]] fn main() -> void {
})");
@@ -593,7 +593,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingType) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<storage_buffer> ssbo : S;
[[group(0), binding(0)]] var<storage_buffer> 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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_multisampled_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_multisampled_2d<f32>;
[[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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_3d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_3d<f32>;
[[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<uniform_constant> myTexture : texture_2d<f32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> void {
})");
wgpu::ShaderModule fsModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<i32>;
[[group(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() -> void {
})");
@@ -691,8 +691,8 @@ TEST_F(GetBindGroupLayoutTests, UnusedIndex) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms0 : S;
[[set(2), binding(0)]] var<uniform> uniforms2 : S;
[[group(0), binding(0)]] var<uniform> uniforms0 : S;
[[group(2), binding(0)]] var<uniform> uniforms2 : S;
[[stage(fragment)]] fn main() -> void {
})");
@@ -733,7 +733,7 @@ TEST_F(GetBindGroupLayoutTests, Reflection) {
[[block]] struct S {
[[offset(0)]] pos : vec4<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
})");

View File

@@ -33,7 +33,7 @@ namespace {
[[block]] struct S {
[[offset(0)]] transform : mat2x2<f32>;
};
[[set(0), binding(0)]] var<uniform> uniforms : S;
[[group(0), binding(0)]] var<uniform> uniforms : S;
[[stage(vertex)]] fn main() -> void {
})");
@@ -42,12 +42,12 @@ namespace {
[[block]] struct Uniforms {
[[offset(0)]] color : vec4<f32>;
};
[[set(1), binding(0)]] var<uniform> uniforms : Uniforms;
[[group(1), binding(0)]] var<uniform> uniforms : Uniforms;
[[block]] struct Storage {
[[offset(0)]] dummy : [[stride(4)]] array<f32>;
};
[[set(1), binding(1)]] var<storage_buffer> ssbo : [[access(read_write)]] Storage;
[[group(1), binding(1)]] var<storage_buffer> ssbo : [[access(read_write)]] Storage;
[[stage(fragment)]] fn main() -> void {
})");

View File

@@ -397,7 +397,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
std::ostringstream stream;
stream << R"(
[[set(0), binding(0)]] var<uniform_constant> myTexture : texture_2d<)"
[[group(0), binding(0)]] var<uniform_constant> 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<uniform_constant> myTexture : )"
[[group(0), binding(0)]] var<uniform_constant> myTexture : )"
<< kTextureKeywords[i] << R"(<f32>;
[[stage(fragment)]] fn main() -> void {
})";
@@ -474,7 +474,7 @@ TEST_F(RenderPipelineValidationTest, StorageBufferInVertexShaderNoLayout) {
[[block]] struct Dst {
[[offset(0)]] data : [[stride(4)]] array<u32, 100>;
};
[[set(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
[[group(0), binding(0)]] var<storage_buffer> dst : [[access(read_write)]] Dst;
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
[[stage(vertex)]] fn main() -> void {
dst.data[VertexIndex] = 0x1234u;

View File

@@ -779,7 +779,7 @@ namespace {
[[block]] struct RBuffer {
[[offset(0)]] value : f32;
};
[[set(0), binding(0)]] var<storage_buffer> rBuffer : [[access(read)]] RBuffer;
[[group(0), binding(0)]] var<storage_buffer> 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<storage_buffer> rBuffer : [[access(read)]] RBuffer;
[[group(0), binding(0)]] var<storage_buffer> 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<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[group(0), binding(0)]] var<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(fragment)]] fn main() -> void {
})");
utils::ComboRenderPipelineDescriptor pipelineDescriptor(device);
@@ -1580,7 +1580,7 @@ namespace {
{
// Create a passthrough compute pipeline with a readonly storage texture
wgpu::ShaderModule csModule = utils::CreateShaderModuleFromWGSL(device, R"(
[[set(0), binding(0)]] var<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[group(0), binding(0)]] var<uniform_constant> tex : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[stage(compute)]] fn main() -> void {
})");
wgpu::ComputePipelineDescriptor pipelineDescriptor;

View File

@@ -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<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[group(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(vertex_idx)]] var<in> VertexIndex : u32;
[[builtin(position)]] var<out> Position : vec4<f32>;
[[stage(vertex)]] fn main() -> void {
@@ -142,7 +142,7 @@ 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<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[group(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(frag_coord)]] var<in> FragCoord : vec4<f32>;
[[location(0)]] var<out> fragColor : vec4<f32>;
[[stage(fragment)]] fn main() -> void {
@@ -197,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<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[group(0), binding(0)]] var<uniform_constant> image0 : [[access(read)]] texture_storage_2d<rgba8unorm>;
[[builtin(local_invocation_id)]] var<in> LocalInvocationID : vec3<u32>;
[[block]] struct Buf {
[[offset(0)]] data : f32;
};
[[set(0), binding(1)]] var<storage_buffer> buf : [[access(read_write)]] Buf;
[[group(0), binding(1)]] var<storage_buffer> buf : [[access(read_write)]] Buf;
[[stage(compute)]] fn main() -> void {
buf.data = textureLoad(image0, vec2<i32>(LocalInvocationID.xy)).x;