From 75cb2da055289d8d4e9bb5de8e4fde127b8ba92c Mon Sep 17 00:00:00 2001 From: Joshua Ashton Date: Fri, 17 Apr 2020 03:51:34 +0100 Subject: [PATCH] Make checkSupportImageSamplingInstance loop through pNexts We need this to support multiple potential pNexts in the future. Affected tests: dEQP-VK.pipeline.sampler.* Components: Vulkan VK-GL-CTS issue: 2331 Change-Id: I076e864d4b842d3993fdfa9bbd5925765870f6f7 --- .../pipeline/vktPipelineImageSamplingInstance.cpp | 27 ++++++++++++++++------ 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp index 5ae09af..cb9bf32 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineImageSamplingInstance.cpp @@ -254,16 +254,29 @@ void checkSupportImageSamplingInstance (Context& context, ImageSamplingInstanceP } } - if (params.samplerParams.pNext != DE_NULL) + void const* pNext = params.samplerParams.pNext; + while (pNext != DE_NULL) { - const VkStructureType nextType = *reinterpret_cast(params.samplerParams.pNext); - - if (nextType == VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT) + const VkStructureType nextType = *reinterpret_cast(pNext); + switch (nextType) { - context.requireDeviceFunctionality("VK_EXT_sampler_filter_minmax"); + case VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT: + { + context.requireDeviceFunctionality("VK_EXT_sampler_filter_minmax"); + + if (!isMinMaxFilteringSupported(context.getInstanceInterface(), context.getPhysicalDevice(), params.imageFormat, VK_IMAGE_TILING_OPTIMAL)) + throw tcu::NotSupportedError(std::string("Unsupported format for min/max filtering: ") + getFormatName(params.imageFormat)); - if (!isMinMaxFilteringSupported(context.getInstanceInterface(), context.getPhysicalDevice(), params.imageFormat, VK_IMAGE_TILING_OPTIMAL)) - throw tcu::NotSupportedError(std::string("Unsupported format for min/max filtering: ") + getFormatName(params.imageFormat)); + pNext = reinterpret_cast(pNext)->pNext; + break; + } + case VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO: + context.requireDeviceFunctionality("VK_KHR_sampler_ycbcr_conversion"); + + pNext = reinterpret_cast(pNext)->pNext; + break; + default: + TCU_FAIL("Unrecognized sType in chained sampler create info"); } } -- 2.7.4