From: Piers Daniell Date: Mon, 3 Dec 2018 22:27:34 +0000 (-0700) Subject: Fix image feature checks for swapchain_mutable.* X-Git-Tag: upstream/1.3.5~2324^2~16 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d4862b7471082c991c9b89161fdbe5c8ae53f1cd;p=platform%2Fupstream%2FVK-GL-CTS.git Fix image feature checks for swapchain_mutable.* This fix mirrors what was already done in https://gerrit.khronos.org/#/c/2799/ for the other image.mutable.* tests. Without this fix the DE_FATAL("Invalid download method") assert will fire for some of the sub tests and the test won't be properly skipped when the platform doesn't support the format. Components: Vulkan Affects: dEQP-VK.image.swapchain_mutable.* VK-GL-CTS Issue: 1295 Change-Id: I009baa8697ae09f7e9b8001b90159658ced4c62a --- diff --git a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp index f045670..1a26ea3 100644 --- a/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp +++ b/external/vulkancts/modules/vulkan/image/vktImageMutableTests.cpp @@ -2115,6 +2115,12 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) case UPLOAD_STORE: viewFormatFeatureFlags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; break; + case UPLOAD_CLEAR: + viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT; + break; + case UPLOAD_COPY: + viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT; + break; default: DE_FATAL("Invalid upload method"); break; @@ -2130,6 +2136,9 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) case DOWNLOAD_LOAD: viewFormatFeatureFlags |= VK_FORMAT_FEATURE_STORAGE_IMAGE_BIT; break; + case DOWNLOAD_COPY: + viewFormatFeatureFlags |= VK_FORMAT_FEATURE_TRANSFER_DST_BIT; + break; default: DE_FATAL("Invalid download method"); break; @@ -2145,17 +2154,26 @@ tcu::TestStatus testSwapchainMutable(Context& context, CaseDef caseDef) if ((viewFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags) TCU_THROW(NotSupportedError, "View format doesn't support upload/download method"); + const bool haveMaintenance2 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2"); + // We don't use the base image for anything other than transfer // operations so there are no features to check. However, The Vulkan // 1.0 spec does not allow us to create an image view with usage that // is not supported by the main format. With VK_KHR_maintenance2, we // can do this via VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR. if ((imageFormatProps.optimalTilingFeatures & viewFormatFeatureFlags) != viewFormatFeatureFlags && - !isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance2")) + !haveMaintenance2) { TCU_THROW(NotSupportedError, "Image format doesn't support upload/download method"); } + // If no format feature flags are supported, the format itself is not supported, + // and images of that format cannot be created. + if (imageFormatProps.optimalTilingFeatures == 0) + { + TCU_THROW(NotSupportedError, "Base image format is not supported"); + } + // Create a color buffer for host-inspection of results // For the Copy download method, this is the target of the download, for other // download methods, pixel data will be copied to this buffer from the download