Mark 1D textures as safe.

Fixed: dawn:814
Change-Id: I216ebdb68cfb1634cfad8b44de998c2f1a87edaf
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/79320
Reviewed-by: Loko Kung <lokokung@google.com>
Commit-Queue: Corentin Wallez <cwallez@chromium.org>
Auto-Submit: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
Corentin Wallez 2022-02-09 18:40:51 +00:00 committed by Dawn LUCI CQ
parent 19bb9563f8
commit 82ca6096ac
2 changed files with 0 additions and 25 deletions

View File

@ -290,14 +290,6 @@ namespace dawn::native {
internalUsageDesc != nullptr && !device->IsFeatureEnabled(Feature::DawnInternalUsages), internalUsageDesc != nullptr && !device->IsFeatureEnabled(Feature::DawnInternalUsages),
"The dawn-internal-usages feature is not enabled"); "The dawn-internal-usages feature is not enabled");
// Support for 1D textures is not complete so they are currently unsafe to use.
DAWN_INVALID_IF(
device->IsToggleEnabled(Toggle::DisallowUnsafeAPIs) &&
descriptor->dimension == wgpu::TextureDimension::e1D,
"Texture with dimension %s are disallowed because they are partially implemented. See "
"https://crbug.com/dawn/814",
wgpu::TextureDimension::e1D);
const Format* format; const Format* format;
DAWN_TRY_ASSIGN(format, device->GetInternalFormat(descriptor->format)); DAWN_TRY_ASSIGN(format, device->GetInternalFormat(descriptor->format));

View File

@ -36,23 +36,6 @@ class UnsafeAPIValidationTest : public ValidationTest {
} }
}; };
// Check that 1D textures are disallowed as part of unsafe APIs.
// TODO(dawn:814): Remove when 1D texture support is complete.
TEST_F(UnsafeAPIValidationTest, 1DTextures) {
wgpu::TextureDescriptor desc;
desc.size = {1, 1, 1};
desc.format = wgpu::TextureFormat::RGBA8Unorm;
desc.usage = wgpu::TextureUsage::CopyDst;
// Control case: 2D textures are allowed.
desc.dimension = wgpu::TextureDimension::e2D;
device.CreateTexture(&desc);
// Error case: 1D textures are disallowed.
desc.dimension = wgpu::TextureDimension::e1D;
ASSERT_DEVICE_ERROR(device.CreateTexture(&desc));
}
// Check that explicit user device.destroy() is disallowed as part of unsafe APIs. // Check that explicit user device.destroy() is disallowed as part of unsafe APIs.
// TODO(crbug.com/dawn/628) Remove when CTS testing is in place and passing. // TODO(crbug.com/dawn/628) Remove when CTS testing is in place and passing.
TEST_F(UnsafeAPIValidationTest, ExplicitDeviceDestroy) { TEST_F(UnsafeAPIValidationTest, ExplicitDeviceDestroy) {