From ff25d4699272b3ee8d05e6306b22aeadecf8315a Mon Sep 17 00:00:00 2001 From: Chip Davis Date: Thu, 3 Sep 2020 19:10:08 -0500 Subject: [PATCH] MVKImage: Reject attempts to create compressed linear images. This doesn't sit well with Metal, which will immediately abort the program on the attempt. --- MoltenVK/MoltenVK/GPUObjects/MVKImage.mm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm index 951e6f77..edd75f77 100644 --- a/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm +++ b/MoltenVK/MoltenVK/GPUObjects/MVKImage.mm @@ -960,6 +960,10 @@ bool MVKImage::validateLinear(const VkImageCreateInfo* pCreateInfo, bool isAttac setConfigurationResult(reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCreateImage() : If tiling is VK_IMAGE_TILING_LINEAR, format must not be a depth/stencil format.")); isLin = false; } + if (getPixelFormats()->getFormatType(pCreateInfo->format) == kMVKFormatCompressed) { + setConfigurationResult(reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCreateImage() : If tiling is VK_IMAGE_TILING_LINEAR, format must not be a compressed format.")); + isLin = false; + } if (pCreateInfo->mipLevels > 1) { setConfigurationResult(reportError(VK_ERROR_FEATURE_NOT_PRESENT, "vkCreateImage() : If tiling is VK_IMAGE_TILING_LINEAR, mipLevels must be 1."));