[Vulkan] Gracefully fail on copy if a target format is unsupported

This commit is contained in:
DrChat
2018-04-13 21:09:21 -05:00
parent abdc0ff05a
commit 399e1fac2a
3 changed files with 15 additions and 6 deletions

View File

@@ -1024,7 +1024,17 @@ bool VulkanCommandProcessor::IssueCopy() {
std::max(1u, dest_logical_height), &texture_info);
auto texture = texture_cache_->DemandResolveTexture(texture_info);
assert_not_null(texture);
if (!texture) {
// Out of memory.
return false;
}
if (!(texture->usage_flags & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT))) {
// Resolve image doesn't support drawing, and we don't support conversion.
return false;
}
texture->in_flight_fence = current_batch_fence_;
// For debugging purposes only (trace viewer)