Skip to content

Commit

Permalink
Compat: Remove WGSL error for rg32xxx formats
Browse files Browse the repository at this point in the history
This is effectively a bindGroupLayout creation error
which makes it pipeline creation error. There are already
tests for this. The spec changed so there is no error
error at shader module creation time.

Fixed: 357042304
Bug: 357042304
Change-Id: I8f5ee20b13dc80022268d32ec65b7882fe29c58a
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/201337
Reviewed-by: dan sinclair <[email protected]>
Commit-Queue: Gregg Tavares <[email protected]>
  • Loading branch information
greggman authored and Dawn LUCI CQ committed Sep 5, 2024
1 parent d9f1142 commit 61959f7
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 50 deletions.
32 changes: 0 additions & 32 deletions src/tint/lang/wgsl/resolver/compatibility_mode_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -63,38 +63,6 @@ class ResolverCompatibilityModeTestWithParam : public TestHelper, public testing
}
};

using ResolverCompatibilityModeTest_StorageTexture = ResolverCompatibilityModeTestWithParam<
std::tuple<core::type::TextureDimension, core::TexelFormat>>;

TEST_P(ResolverCompatibilityModeTest_StorageTexture, RGStorageTextures) {
// @group(2) @binding(1) var tex: texture_storage_xxx<formatxxx, read_write>
auto dim = std::get<0>(GetParam());
auto fmt = std::get<1>(GetParam());
auto t = ty.storage_texture(Source{{12, 34}}, dim, fmt, core::Access::kReadWrite);
GlobalVar("tex", t,
Vector{
Group(2_a),
Binding(1_a),
});

StringStream err;
err << "12:34 error: format " << fmt
<< " is not supported as a storage texture in compatibility mode";

EXPECT_FALSE(r()->Resolve());
EXPECT_EQ(r()->error(), err.str());
}

INSTANTIATE_TEST_SUITE_P(ResolverCompatibilityModeTest,
ResolverCompatibilityModeTest_StorageTexture,
testing::Combine(testing::Values(core::type::TextureDimension::k1d,
core::type::TextureDimension::k2d,
core::type::TextureDimension::k2dArray,
core::type::TextureDimension::k3d),
testing::Values(core::TexelFormat::kRg32Float,
core::TexelFormat::kRg32Sint,
core::TexelFormat::kRg32Uint)));

TEST_F(ResolverCompatibilityModeTest, LinearInterpolation_Parameter) {
// @fragment
// fn main(@location(1) @interpolate(linear) value : f32) {
Expand Down
18 changes: 0 additions & 18 deletions src/tint/lang/wgsl/resolver/validator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,6 @@ bool IsValidStorageTextureTexelFormat(core::TexelFormat format) {
}
}

bool IsInvalidStorageTextureTexelFormatInCompatibilityMode(core::TexelFormat format) {
switch (format) {
case core::TexelFormat::kRg32Float:
case core::TexelFormat::kRg32Sint:
case core::TexelFormat::kRg32Uint:
return true;
default:
return false;
}
}

template <typename CALLBACK>
void TraverseCallChain(const sem::Function* from, const sem::Function* to, CALLBACK&& callback) {
for (auto* f : from->TransitivelyCalledFunctions()) {
Expand Down Expand Up @@ -448,13 +437,6 @@ bool Validator::StorageTexture(const core::type::StorageTexture* t, const Source
return false;
}

if (mode_ == wgsl::ValidationMode::kCompat &&
IsInvalidStorageTextureTexelFormatInCompatibilityMode(t->TexelFormat())) {
AddError(source) << "format " << t->TexelFormat()
<< " is not supported as a storage texture in compatibility mode";
return false;
}

return true;
}

Expand Down

0 comments on commit 61959f7

Please sign in to comment.