Allow creating texture views from destroyed textures

Bug: dawn:1031
Change-Id: I3af52d5c53c4ccf2c30a4eccb9c50dfe2e822f25
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/60221
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Reviewed-by: Jiawei Shao <jiawei.shao@intel.com>
Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
Austin Eng
2021-07-29 21:49:47 +00:00
committed by Dawn LUCI CQ
parent f43822a3fd
commit da3c5ef3a9
6 changed files with 35 additions and 5 deletions

View File

@@ -510,13 +510,13 @@ namespace {
}
}
// Test that it's invalid to create a texture view from a destroyed texture
// Test that it's valid to create a texture view from a destroyed texture
TEST_F(TextureViewValidationTest, DestroyCreateTextureView) {
wgpu::Texture texture = Create2DArrayTexture(device, 1);
wgpu::TextureViewDescriptor descriptor =
CreateDefaultViewDescriptor(wgpu::TextureViewDimension::e2D);
texture.Destroy();
ASSERT_DEVICE_ERROR(texture.CreateView(&descriptor));
texture.CreateView(&descriptor);
}
// Test that the selected TextureAspects must exist in the texture format