mirror of
https://github.com/encounter/dawn-cmake.git
synced 2025-07-03 03:35:59 +00:00
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>
This commit is contained in:
parent
b5d561be5a
commit
b326f8c172
@ -268,13 +268,6 @@ namespace dawn_native {
|
|||||||
|
|
||||||
ASSERT(texture->GetDimension() != wgpu::TextureDimension::e1D);
|
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:
|
// Validation for the copy being in-bounds:
|
||||||
Extent3D mipSize = texture->GetMipLevelPhysicalSize(textureCopy.mipLevel);
|
Extent3D mipSize = texture->GetMipLevelPhysicalSize(textureCopy.mipLevel);
|
||||||
// For 1D/2D textures, include the array layer as depth so it can be checked with other
|
// For 1D/2D textures, include the array layer as depth so it can be checked with other
|
||||||
|
@ -270,13 +270,6 @@ namespace dawn_native {
|
|||||||
return DAWN_VALIDATION_ERROR("Cannot create an empty texture");
|
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) {
|
if (descriptor->dimension != wgpu::TextureDimension::e2D && format->isCompressed) {
|
||||||
return DAWN_VALIDATION_ERROR("Compressed texture must be 2D");
|
return DAWN_VALIDATION_ERROR("Compressed texture must be 2D");
|
||||||
}
|
}
|
||||||
@ -323,13 +316,6 @@ namespace dawn_native {
|
|||||||
return DAWN_VALIDATION_ERROR("1D texture views aren't supported (yet).");
|
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(ValidateTextureFormat(descriptor->format));
|
||||||
|
|
||||||
DAWN_TRY(ValidateTextureAspect(descriptor->aspect));
|
DAWN_TRY(ValidateTextureAspect(descriptor->aspect));
|
||||||
|
@ -28,22 +28,6 @@ class UnsafeAPIValidationTest : public ValidationTest {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// 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.
|
// Check that DrawIndexedIndirect is disallowed as part of unsafe APIs.
|
||||||
TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) {
|
TEST_F(UnsafeAPIValidationTest, DrawIndexedIndirectDisallowed) {
|
||||||
// Create the index and indirect buffers.
|
// Create the index and indirect buffers.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user