From: Pyry Haulos Date: Fri, 22 Jan 2016 21:27:31 +0000 (-0800) Subject: Check compressed 3D format support in PipelineImageSamplingInstance X-Git-Tag: upstream/0.1.0~812^2~96^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=73d1b62ab9f3fea5cf26e8d80763bf150de6319b;p=platform%2Fupstream%2FVK-GL-CTS.git Check compressed 3D format support in PipelineImageSamplingInstance Fixes #238 Change-Id: I7496a27b445e98b341bdc10c9da76aff5ad996cd --- diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp index 35f9167..3783907 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp @@ -377,6 +377,30 @@ ImageSamplingInstance::ImageSamplingInstance (Context& context, !isLinearFilteringSupported(context.getInstanceInterface(), context.getPhysicalDevice(), imageFormat, VK_IMAGE_TILING_OPTIMAL)) throw tcu::NotSupportedError(std::string("Unsupported format for linear filtering: ") + getFormatName(imageFormat)); + if (isCompressedFormat(imageFormat) && imageViewType == VK_IMAGE_VIEW_TYPE_3D) + { + // \todo [2016-01-22 pyry] Mandate VK_ERROR_FORMAT_NOT_SUPPORTED + try + { + const VkImageFormatProperties formatProperties = getPhysicalDeviceImageFormatProperties(context.getInstanceInterface(), + context.getPhysicalDevice(), + imageFormat, + VK_IMAGE_TYPE_3D, + VK_IMAGE_TILING_OPTIMAL, + VK_IMAGE_USAGE_SAMPLED_BIT, + (VkImageCreateFlags)0); + + if (formatProperties.maxExtent.width == 0 && + formatProperties.maxExtent.height == 0 && + formatProperties.maxExtent.depth == 0) + TCU_THROW(NotSupportedError, "3D compressed format not supported"); + } + catch (const Error&) + { + TCU_THROW(NotSupportedError, "3D compressed format not supported"); + } + } + // Create texture image, view and sampler { VkImageCreateFlags imageFlags = 0u;