Report error when plane0 is not a valid object in CreateExternalTexture
BUG=chromium:1197329 TEST=dawn_unittests Change-Id: I801e1d8800c4138e1a3d6040cf623c58063bc30b Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/47400 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: Corentin Wallez <cwallez@chromium.org>
This commit is contained in:
parent
4a7c120456
commit
59f2038dce
|
@ -55,6 +55,8 @@ namespace dawn_native {
|
|||
ASSERT(descriptor);
|
||||
ASSERT(descriptor->plane0);
|
||||
|
||||
DAWN_TRY(device->ValidateObject(descriptor->plane0));
|
||||
|
||||
const Format* format;
|
||||
DAWN_TRY_ASSIGN(format, device->GetInternalFormat(descriptor->format));
|
||||
|
||||
|
|
|
@ -94,6 +94,22 @@ namespace {
|
|||
externalDesc.format = kUnsupportedFormat;
|
||||
ASSERT_DEVICE_ERROR(device.CreateExternalTexture(&externalDesc));
|
||||
}
|
||||
|
||||
// Creating an external texture with an error texture view should fail.
|
||||
{
|
||||
wgpu::Texture internalTexture = device.CreateTexture(&textureDescriptor);
|
||||
wgpu::TextureViewDescriptor errorViewDescriptor;
|
||||
errorViewDescriptor.format = kDefaultTextureFormat;
|
||||
errorViewDescriptor.dimension = wgpu::TextureViewDimension::e2D;
|
||||
errorViewDescriptor.mipLevelCount = 1;
|
||||
errorViewDescriptor.arrayLayerCount = 2;
|
||||
ASSERT_DEVICE_ERROR(wgpu::TextureView errorTextureView =
|
||||
internalTexture.CreateView(&errorViewDescriptor));
|
||||
|
||||
externalDesc.plane0 = errorTextureView;
|
||||
externalDesc.format = kDefaultTextureFormat;
|
||||
ASSERT_DEVICE_ERROR(device.CreateExternalTexture(&externalDesc));
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
Loading…
Reference in New Issue