[Vulkan] Handle AllocateTextureRegion failures
This commit is contained in:
parent
80fb0ba71a
commit
ecbdebb43b
|
@ -355,6 +355,11 @@ TextureCache::Texture* TextureCache::AllocateTexture(
|
|||
|
||||
TextureRegion* base_region = AllocateTextureRegion(
|
||||
texture, region_offset, region_extent, required_flags);
|
||||
if (!base_region) {
|
||||
delete texture;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
texture->base_region = base_region;
|
||||
return texture;
|
||||
}
|
||||
|
@ -514,7 +519,7 @@ TextureCache::TextureRegion* TextureCache::DemandRegion(
|
|||
VK_FORMAT_FEATURE_SAMPLED_IMAGE_BIT);
|
||||
}
|
||||
|
||||
if (command_buffer && !region->region_contents_valid) {
|
||||
if (command_buffer && region && !region->region_contents_valid) {
|
||||
// Region content is out-of-date, recreate it by blitting from the base
|
||||
// region.
|
||||
|
||||
|
|
Loading…
Reference in New Issue