Validate that the device is alive when wrapping external images
Will be tested in Chromium's webgpu_mailbox_unittest.cc Bug: chromium:1359106 Change-Id: I8a9bf01cd593f2835e2876fa04139fd3afda9b2e Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/103462 Reviewed-by: Loko Kung <lokokung@google.com> Commit-Queue: Austin Eng <enga@chromium.org>
This commit is contained in:
parent
d4dd547bae
commit
534a198f88
|
@ -464,7 +464,9 @@ MaybeError Device::CopyFromStagingToTexture(const StagingBufferBase* source,
|
|||
Ref<Texture> Device::CreateTextureWrappingIOSurface(const ExternalImageDescriptor* descriptor,
|
||||
IOSurfaceRef ioSurface) {
|
||||
const TextureDescriptor* textureDescriptor = FromAPI(descriptor->cTextureDescriptor);
|
||||
|
||||
if (ConsumedError(ValidateIsAlive())) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ConsumedError(ValidateTextureDescriptor(this, textureDescriptor))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -904,6 +904,9 @@ TextureBase* Device::CreateTextureWrappingVulkanImage(
|
|||
const TextureDescriptor* textureDescriptor = FromAPI(descriptor->cTextureDescriptor);
|
||||
|
||||
// Initial validation
|
||||
if (ConsumedError(ValidateIsAlive())) {
|
||||
return nullptr;
|
||||
}
|
||||
if (ConsumedError(ValidateTextureDescriptor(this, textureDescriptor))) {
|
||||
return nullptr;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue