Remove UnsafeAPI toggle for 3D texture
3D texture implementation has already been done. It's time to remove
the UnsafeAPI toggle for it.
Bug: dawn:547
Change-Id: Ic9e0930d7906ee5274b9e412ebacb2574744b2b3
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/56480
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Austin Eng <enga@chromium.org>
Commit-Queue: Yunchao He <yunchao.he@intel.com>
diff --git a/src/dawn_native/CommandValidation.cpp b/src/dawn_native/CommandValidation.cpp
index e46d438..9654b2a 100644
--- a/src/dawn_native/CommandValidation.cpp
+++ b/src/dawn_native/CommandValidation.cpp
@@ -268,13 +268,6 @@
ASSERT(texture->GetDimension() != wgpu::TextureDimension::e1D);
- // Disallow copy to/from a 3D texture as unsafe until it is fully implemented.
- if (texture->GetDimension() == wgpu::TextureDimension::e3D &&
- device->IsToggleEnabled(Toggle::DisallowUnsafeAPIs)) {
- return DAWN_VALIDATION_ERROR(
- "Copy to/from a 3D texture is disallowed because it is not fully implemented");
- }
-
// Validation for the copy being in-bounds:
Extent3D mipSize = texture->GetMipLevelPhysicalSize(textureCopy.mipLevel);
// For 1D/2D textures, include the array layer as depth so it can be checked with other
diff --git a/src/dawn_native/Texture.cpp b/src/dawn_native/Texture.cpp
index 293e0a8..d9567d5 100644
--- a/src/dawn_native/Texture.cpp
+++ b/src/dawn_native/Texture.cpp
@@ -270,13 +270,6 @@
return DAWN_VALIDATION_ERROR("Cannot create an empty texture");
}
- // Disallow 1D and 3D textures as unsafe until they are fully implemented.
- if (descriptor->dimension != wgpu::TextureDimension::e2D &&
- device->IsToggleEnabled(Toggle::DisallowUnsafeAPIs)) {
- return DAWN_VALIDATION_ERROR(
- "1D and 3D textures are disallowed because they are not fully implemented");
- }
-
if (descriptor->dimension != wgpu::TextureDimension::e2D && format->isCompressed) {
return DAWN_VALIDATION_ERROR("Compressed texture must be 2D");
}
@@ -323,13 +316,6 @@
return DAWN_VALIDATION_ERROR("1D texture views aren't supported (yet).");
}
- // Disallow 3D views as unsafe until they are fully implemented.
- if (descriptor->dimension == wgpu::TextureViewDimension::e3D &&
- device->IsToggleEnabled(Toggle::DisallowUnsafeAPIs)) {
- return DAWN_VALIDATION_ERROR(
- "3D views are disallowed because they are not fully implemented");
- }
-
DAWN_TRY(ValidateTextureFormat(descriptor->format));
DAWN_TRY(ValidateTextureAspect(descriptor->aspect));
diff --git a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp
index 61b3271..c5cab0f 100644
--- a/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp
+++ b/src/tests/unittests/validation/UnsafeAPIValidationTests.cpp
@@ -28,22 +28,6 @@
}
};
-// Check that 3D Texture creation is disallowed as part of unsafe APIs.
-TEST_F(UnsafeAPIValidationTest, 3DTextureCreationDisallowed) {
- wgpu::TextureDescriptor baseDesc;
- baseDesc.size = {32, 32, 6};
- baseDesc.format = wgpu::TextureFormat::RGBA8Unorm;
- baseDesc.usage = wgpu::TextureUsage::Sampled;
-
- // Control case: 2D (array) texture creation is allowed.
- device.CreateTexture(&baseDesc);
-
- // 3D texture creation is disallowed.
- wgpu::TextureDescriptor texture3DDesc = baseDesc;
- texture3DDesc.dimension = wgpu::TextureDimension::e3D;
- ASSERT_DEVICE_ERROR(device.CreateTexture(&texture3DDesc));
-}
-
// Check that DrawIndexedIndirect is disallowed as part of unsafe APIs.
TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) {
// Create the index and indirect buffers.