From 0edad9e02c99c719f1d5d0d98343da81335bdaf8 Mon Sep 17 00:00:00 2001 From: Gary Sweet Date: Thu, 27 Jul 2017 10:42:14 +0100 Subject: [PATCH] Respect sampleRateShading availability in interpolate tests Most of the tests in the dEQP-VK.pipeline.multisample_interpolation group use one of the interpolatAt*() functions in their shaders. These are only valid if sampleRateShading is available. The multisampleStateInfo also blindly sets sampleShadingEnable to true without checking. Affects: dEQP-VK.pipeline.multisample_interpolation.* Components: Vulkan VK-GL-CTS issue: 600 Change-Id: I0d8a85bcf9b59f1b9513482abef8cbf4ecabace3 --- .../pipeline/vktPipelineMultisampleBaseResolve.cpp | 23 +++++++++++----------- .../vktPipelineMultisampleInterpolationTests.cpp | 21 ++++++++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolve.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolve.cpp index fb1f667..fe30e8f 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolve.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolve.cpp @@ -39,16 +39,17 @@ using namespace vk; tcu::TestStatus MSInstanceBaseResolve::iterate (void) { - const InstanceInterface& instance = m_context.getInstanceInterface(); - const DeviceInterface& deviceInterface = m_context.getDeviceInterface(); - const VkDevice device = m_context.getDevice(); - const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice(); - Allocator& allocator = m_context.getDefaultAllocator(); - const VkQueue queue = m_context.getUniversalQueue(); - const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex(); - - VkImageCreateInfo imageMSInfo; - VkImageCreateInfo imageRSInfo; + const InstanceInterface& instance = m_context.getInstanceInterface(); + const DeviceInterface& deviceInterface = m_context.getDeviceInterface(); + const VkDevice device = m_context.getDevice(); + const VkPhysicalDevice physicalDevice = m_context.getPhysicalDevice(); + const VkPhysicalDeviceFeatures& features = m_context.getDeviceFeatures(); + Allocator& allocator = m_context.getDefaultAllocator(); + const VkQueue queue = m_context.getUniversalQueue(); + const deUint32 queueFamilyIndex = m_context.getUniversalQueueFamilyIndex(); + + VkImageCreateInfo imageMSInfo; + VkImageCreateInfo imageRSInfo; // Check if image size does not exceed device limits validateImageSize(instance, physicalDevice, m_imageType, m_imageMSParams.imageSize); @@ -282,7 +283,7 @@ tcu::TestStatus MSInstanceBaseResolve::iterate (void) DE_NULL, // const void* pNext; (VkPipelineMultisampleStateCreateFlags)0u, // VkPipelineMultisampleStateCreateFlags flags; imageMSInfo.samples, // VkSampleCountFlagBits rasterizationSamples; - VK_TRUE, // VkBool32 sampleShadingEnable; + features.sampleRateShading, // VkBool32 sampleShadingEnable; 1.0f, // float minSampleShading; DE_NULL, // const VkSampleMask* pSampleMask; VK_FALSE, // VkBool32 alphaToCoverageEnable; diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleInterpolationTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleInterpolationTests.cpp index d10e0d6..71b4c3c 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleInterpolationTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleInterpolationTests.cpp @@ -287,6 +287,9 @@ template<> void MSCase::initPrograms (v template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -409,6 +412,9 @@ template<> void MSCase::initPrograms (vk: template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -478,6 +484,9 @@ template<> void MSCase::initPrograms ( template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -546,6 +555,9 @@ template<> void MSCase::initPrograms (vk:: template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -614,6 +626,9 @@ template<> void MSCase::initPrograms (vk template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -689,6 +704,9 @@ template<> void MSCase::initPrograms (vk:: template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } @@ -759,6 +777,9 @@ template<> void MSCase::initPrograms (v template<> TestInstance* MSCase::createInstance (Context& context) const { + if (!context.getDeviceFeatures().sampleRateShading) + TCU_THROW(NotSupportedError, "sampleRateShading support required"); + return new MSInstance(context, m_imageMSParams); } -- 2.7.4