wgsl: Remove unnecessary phony-assignments

A call-statement can now be made on a function that returns a value.

Bug: tint:1256
Change-Id: I9a3cc4e330f7441e09dc408bdc1cfa515adac392
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/67382
Commit-Queue: Ben Clayton <bclayton@google.com>
Auto-Submit: Ben Clayton <bclayton@google.com>
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Ben Clayton 2021-10-25 15:27:52 +00:00 committed by Dawn LUCI CQ
parent 5c4ce7bd9b
commit 066ab14e34
4 changed files with 38 additions and 38 deletions

View File

@ -2072,12 +2072,12 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DShaderFS[] = R"( constexpr char kTexture2DShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
constexpr char kTexture2DShaderCS[] = R"( constexpr char kTexture2DShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(compute), workgroup_size(1)]] fn main() { [[stage(compute), workgroup_size(1)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
// Render: Test that 2D texture with 2D view dimension works // Render: Test that 2D texture with 2D view dimension works
@ -2111,12 +2111,12 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DArrayShaderFS[] = R"( constexpr char kTexture2DArrayShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>; [[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
constexpr char kTexture2DArrayShaderCS[] = R"( constexpr char kTexture2DArrayShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>; [[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(compute), workgroup_size(1)]] fn main() { [[stage(compute), workgroup_size(1)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
// Render: Test that 2D texture array with 2D array view dimension works // Render: Test that 2D texture array with 2D array view dimension works
@ -2471,7 +2471,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_2d<f32>; [[group(0), binding(1)]] var myTexture: texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})"); })");
} }
@ -2485,7 +2485,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_2d<f32>; [[group(0), binding(1)]] var myTexture: texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})"); })");
} }
@ -2499,7 +2499,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_depth_2d; [[group(0), binding(1)]] var myTexture: texture_depth_2d;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})"); })");
} }
@ -2513,7 +2513,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_depth_2d; [[group(0), binding(1)]] var myTexture: texture_depth_2d;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})"); })");
} }
@ -2527,7 +2527,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler_comparison; [[group(0), binding(0)]] var mySampler: sampler_comparison;
[[group(0), binding(1)]] var myTexture: texture_depth_2d; [[group(0), binding(1)]] var myTexture: texture_depth_2d;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSampleCompare(myTexture, mySampler, vec2<f32>(0.0, 0.0), 0.0); textureSampleCompare(myTexture, mySampler, vec2<f32>(0.0, 0.0), 0.0);
})"); })");
} }
@ -2541,7 +2541,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_2d<f32>; [[group(0), binding(1)]] var myTexture: texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})")); })"));
} }
@ -2555,7 +2555,7 @@ TEST_F(SamplerTypeBindingTest, ShaderAndBGLMatches) {
[[group(0), binding(0)]] var mySampler: sampler; [[group(0), binding(0)]] var mySampler: sampler;
[[group(0), binding(1)]] var myTexture: texture_2d<f32>; [[group(0), binding(1)]] var myTexture: texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0)); textureSample(myTexture, mySampler, vec2<f32>(0.0, 0.0));
})"); })");
} }
} }

View File

@ -190,7 +190,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[group(0), binding(1)]] var mySampler : sampler; [[group(0), binding(1)]] var mySampler : sampler;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
_ = textureLoad(myTexture, vec2<i32>(), 0); textureLoad(myTexture, vec2<i32>(), 0);
_ = mySampler; _ = mySampler;
return vec4<f32>(); return vec4<f32>();
})"); })");
@ -199,7 +199,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[group(0), binding(1)]] var mySampler : sampler; [[group(0), binding(1)]] var mySampler : sampler;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
_ = textureSampleLevel(myTexture, mySampler, vec2<f32>(), 0.0); textureSampleLevel(myTexture, mySampler, vec2<f32>(), 0.0);
return vec4<f32>(); return vec4<f32>();
})"); })");
@ -215,7 +215,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[group(0), binding(1)]] var mySampler : sampler; [[group(0), binding(1)]] var mySampler : sampler;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureLoad(myTexture, vec2<i32>(), 0); textureLoad(myTexture, vec2<i32>(), 0);
_ = mySampler; _ = mySampler;
})"); })");
@ -223,7 +223,7 @@ TEST_F(GetBindGroupLayoutTests, DefaultTextureSampleType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[group(0), binding(1)]] var mySampler : sampler; [[group(0), binding(1)]] var mySampler : sampler;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureSample(myTexture, mySampler, vec2<f32>()); textureSample(myTexture, mySampler, vec2<f32>());
})"); })");
auto BGLFromModules = [this](wgpu::ShaderModule vertexModule, auto BGLFromModules = [this](wgpu::ShaderModule vertexModule,
@ -394,7 +394,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -406,7 +406,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -475,7 +475,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_1d<f32>; [[group(0), binding(0)]] var myTexture : texture_1d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -487,7 +487,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -499,7 +499,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>; [[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -511,7 +511,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_3d<f32>; [[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -523,7 +523,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_cube<f32>; [[group(0), binding(0)]] var myTexture : texture_cube<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -535,7 +535,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_cube_array<f32>; [[group(0), binding(0)]] var myTexture : texture_cube_array<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -563,7 +563,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -575,7 +575,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<i32>; [[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -587,7 +587,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<u32>; [[group(0), binding(0)]] var myTexture : texture_2d<u32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting( EXPECT_TRUE(dawn_native::BindGroupLayoutBindingsEqualForTesting(
device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get())); device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get()));
@ -900,7 +900,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
return vec4<f32>(); return vec4<f32>();
})"); })");
@ -908,7 +908,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor; utils::ComboRenderPipelineDescriptor descriptor;
@ -925,7 +925,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
return vec4<f32>(); return vec4<f32>();
})"); })");
@ -933,7 +933,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_3d<f32>; [[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor; utils::ComboRenderPipelineDescriptor descriptor;
@ -950,7 +950,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>; [[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> { [[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
return vec4<f32>(); return vec4<f32>();
})"); })");
@ -958,7 +958,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<i32>; [[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"); })");
utils::ComboRenderPipelineDescriptor descriptor; utils::ComboRenderPipelineDescriptor descriptor;

View File

@ -639,7 +639,7 @@ TEST_F(RenderPipelineValidationTest, TextureComponentTypeCompatibility) {
<< kScalarTypes[i] << R"(>; << kScalarTypes[i] << R"(>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str()); descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
descriptor.cTargets[0].writeMask = wgpu::ColorWriteMask::None; descriptor.cTargets[0].writeMask = wgpu::ColorWriteMask::None;
@ -688,7 +688,7 @@ TEST_F(RenderPipelineValidationTest, TextureViewDimensionCompatibility) {
[[group(0), binding(0)]] var myTexture : )" [[group(0), binding(0)]] var myTexture : )"
<< kTextureKeywords[i] << R"(<f32>; << kTextureKeywords[i] << R"(<f32>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(myTexture); textureDimensions(myTexture);
})"; })";
descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str()); descriptor.cFragment.module = utils::CreateShaderModule(device, stream.str().c_str());
descriptor.cTargets[0].writeMask = wgpu::ColorWriteMask::None; descriptor.cTargets[0].writeMask = wgpu::ColorWriteMask::None;

View File

@ -83,7 +83,7 @@ class StorageTextureValidationTests : public ValidationTest {
<< imageFormatQualifier << ", " << access << imageFormatQualifier << ", " << access
<< ">;\n" << ">;\n"
"[[stage(compute), workgroup_size(1)]] fn main() {\n" "[[stage(compute), workgroup_size(1)]] fn main() {\n"
" _ = textureDimensions(image0);\n" " textureDimensions(image0);\n"
"}\n"; "}\n";
return ostream.str(); return ostream.str();
@ -176,7 +176,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>; [[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(vertex)]] fn main() { [[stage(vertex)]] fn main() {
_ = textureDimensions(image0); textureDimensions(image0);
})")); })"));
} }
@ -185,7 +185,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>; [[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(fragment)]] fn main() { [[stage(fragment)]] fn main() {
_ = textureDimensions(image0); textureDimensions(image0);
})")); })"));
} }
@ -194,7 +194,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"( ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>; [[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(compute), workgroup_size(1)]] fn main() { [[stage(compute), workgroup_size(1)]] fn main() {
_ = textureDimensions(image0); textureDimensions(image0);
})")); })"));
} }
} }