Wrap call stmts with non-void rets, with ignore()

We have a new validation rule that states that all calls to functions that return a value must use that value. ignore() is the escape hatch.

Bug: tint:886
Change-Id: I9ab8d288b3c54ad4b7e46feda129c36c9136c20b
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/54200
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2021-06-11 14:01:29 +00:00 committed by Dawn LUCI CQ
parent f102e1138b
commit 6133e5cf3d
4 changed files with 28 additions and 28 deletions

View File

@ -1978,12 +1978,12 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})";
constexpr char kTexture2DShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(compute)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})";
// Render: Test that 2D texture with 2D view dimension works
@ -2017,12 +2017,12 @@ TEST_F(BindGroupLayoutCompatibilityTest, TextureViewDimension) {
constexpr char kTexture2DArrayShaderFS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})";
constexpr char kTexture2DArrayShaderCS[] = R"(
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(compute)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})";
// Render: Test that 2D texture array with 2D array view dimension works
@ -2071,7 +2071,7 @@ TEST_F(BindGroupLayoutCompatibilityTest, DISABLED_ExternalTextureBindGroupLayout
ASSERT_DEVICE_ERROR(CreateFSRenderPipeline(R"(
[[group(0), binding(0)]] var myTexture: texture_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})",
{bgl}));
}

View File

@ -245,7 +245,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -256,7 +256,7 @@ TEST_F(GetBindGroupLayoutTests, BindingType) {
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -323,7 +323,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_1d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -334,7 +334,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -345,7 +345,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d_array<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -356,7 +356,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -367,7 +367,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_cube<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -378,7 +378,7 @@ TEST_F(GetBindGroupLayoutTests, ViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_cube_array<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -405,7 +405,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -416,7 +416,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -427,7 +427,7 @@ TEST_F(GetBindGroupLayoutTests, TextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<u32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
EXPECT_EQ(device.CreateBindGroupLayout(&desc).Get(), pipeline.GetBindGroupLayout(0).Get());
}
@ -727,7 +727,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
return vec4<f32>();
})");
@ -735,7 +735,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureMultisampling) {
[[group(0), binding(0)]] var myTexture : texture_multisampled_2d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
utils::ComboRenderPipelineDescriptor descriptor;
@ -752,7 +752,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
return vec4<f32>();
})");
@ -760,7 +760,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingViewDimension) {
[[group(0), binding(0)]] var myTexture : texture_3d<f32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
utils::ComboRenderPipelineDescriptor descriptor;
@ -777,7 +777,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<f32>;
[[stage(vertex)]] fn main() -> [[builtin(position)]] vec4<f32> {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
return vec4<f32>();
})");
@ -785,7 +785,7 @@ TEST_F(GetBindGroupLayoutTests, ConflictingBindingTextureComponentType) {
[[group(0), binding(0)]] var myTexture : texture_2d<i32>;
[[stage(fragment)]] fn main() {
textureDimensions(myTexture);
ignore(textureDimensions(myTexture));
})");
utils::ComboRenderPipelineDescriptor descriptor;

View File

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

View File

@ -86,7 +86,7 @@ class StorageTextureValidationTests : public ValidationTest {
<< imageFormatQualifier << ", " << access
<< ">;\n"
"[[stage(compute)]] fn main() {\n"
" textureDimensions(image0);\n"
" ignore(textureDimensions(image0));\n"
"}\n";
return ostream.str();
@ -231,7 +231,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(vertex)]] fn main() {
textureDimensions(image0);
ignore(textureDimensions(image0));
})"));
}
@ -240,7 +240,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(fragment)]] fn main() {
textureDimensions(image0);
ignore(textureDimensions(image0));
})"));
}
@ -249,7 +249,7 @@ TEST_F(StorageTextureValidationTests, ReadWriteStorageTexture) {
ASSERT_DEVICE_ERROR(utils::CreateShaderModule(device, R"(
[[group(0), binding(0)]] var image0 : texture_storage_2d<rgba8unorm, read_write>;
[[stage(compute)]] fn main() {
textureDimensions(image0);
ignore(textureDimensions(image0));
})"));
}
}