[dawn][native] Remove DisableTextureViewBindingUsedAsExternalTexture
This was a kill switch while shipping the feature but isn't needed
anymore.
Bug: 398752857
Change-Id: I46f02492369ffcb9a1602fa2012e2df9e22e98a9
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/262197
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
diff --git a/src/dawn/native/BindGroup.cpp b/src/dawn/native/BindGroup.cpp
index 3075b45..8f46557 100644
--- a/src/dawn/native/BindGroup.cpp
+++ b/src/dawn/native/BindGroup.cpp
@@ -606,17 +606,11 @@
layout->GetExternalTextureBindingExpansionMap()));
continue;
}
- if (!device->IsToggleEnabled(Toggle::DisableTextureViewBindingUsedAsExternalTexture)) {
DAWN_TRY_CONTEXT(ValidateTextureViewBindingUsedAsExternalTexture(device, entry),
"validating entries[%u] as a TextureView."
"\nExpected entry layout: %s",
i, layout);
continue;
- }
- return DAWN_VALIDATION_ERROR(
- "entries[%u] not an ExternalTexture when the layout contains an ExternalTexture "
- "entry.",
- i);
}
const TexelBufferBindingEntry* texelBufferEntry = unpacked.Get<TexelBufferBindingEntry>();
diff --git a/src/dawn/native/Toggles.cpp b/src/dawn/native/Toggles.cpp
index 12938315..5869846 100644
--- a/src/dawn/native/Toggles.cpp
+++ b/src/dawn/native/Toggles.cpp
@@ -173,10 +173,6 @@
{Toggle::MetalEnableVertexPulling,
{"metal_enable_vertex_pulling", "Uses vertex pulling to protect out-of-bounds reads on Metal",
"https://crbug.com/dawn/480", ToggleStage::Device}},
- {Toggle::DisableTextureViewBindingUsedAsExternalTexture,
- {"disable_texture_view_binding_used_as_external_texture",
- "Disable using a texture view for an externalTexture binding.", "http://crbug.com/398752857",
- ToggleStage::Device}},
{Toggle::AllowUnsafeAPIs,
{"allow_unsafe_apis",
"Suppresses validation errors on API entry points or parameter combinations that aren't "
diff --git a/src/dawn/native/Toggles.h b/src/dawn/native/Toggles.h
index 80e334b..d57717d 100644
--- a/src/dawn/native/Toggles.h
+++ b/src/dawn/native/Toggles.h
@@ -67,7 +67,6 @@
UseDXC,
DisableRobustness,
MetalEnableVertexPulling,
- DisableTextureViewBindingUsedAsExternalTexture,
AllowUnsafeAPIs,
FlushBeforeClientWaitSync,
UseTempBufferInSmallFormatTextureToTextureCopyFromGreaterToLessMipLevel,
diff --git a/src/dawn/tests/unittests/validation/ExternalTextureTests.cpp b/src/dawn/tests/unittests/validation/ExternalTextureTests.cpp
index 6b0eb89..5761ca1 100644
--- a/src/dawn/tests/unittests/validation/ExternalTextureTests.cpp
+++ b/src/dawn/tests/unittests/validation/ExternalTextureTests.cpp
@@ -684,29 +684,6 @@
}
}
-class ExternalTextureTestEnabledToggle : public ExternalTextureTest {
- protected:
- std::vector<const char*> GetEnabledToggles() override {
- return {"disable_texture_view_binding_used_as_external_texture"};
- }
-};
-
-// Regression test for crbug.com/1343099 where BindGroup validation let other binding types be used
-// for external texture bindings.
-TEST_F(ExternalTextureTestEnabledToggle, TextureViewBindingDoesntMatch) {
- wgpu::BindGroupLayout bgl = utils::MakeBindGroupLayout(
- device, {{0, wgpu::ShaderStage::Fragment, &utils::kExternalTextureBindingLayout}});
-
- wgpu::TextureDescriptor textureDescriptor = CreateTextureDescriptor();
- wgpu::Texture texture = device.CreateTexture(&textureDescriptor);
-
- // The bug was that this passed validation and crashed inside the backends with a null
- // dereference. It passed validation because the number of bindings matched (1 == 1) and that
- // the validation didn't check that an external texture binding was required, fell back to
- // checking for the binding type of entry 0 that had been decayed to be a sampled texture view.
- ASSERT_DEVICE_ERROR(utils::MakeBindGroup(device, bgl, {{0, texture.CreateView()}}));
-}
-
// Ensure that bind group validation catches error external textures.
TEST_F(ExternalTextureTest, UseErrorExternalTextureInBindGroup) {
// Control case should succeed.