From 9d2a44ee04f5f3df8077ba659c73435cb707fa40 Mon Sep 17 00:00:00 2001 From: Ilkka Saarelainen Date: Wed, 26 Jun 2019 12:02:15 +0300 Subject: [PATCH] Fix feature requirements of sample mask tests Some multisample sample mask tests required sampleRateShading feature even though it is not actually needed. This CL removes the feature requirement from those tests. Following tests don't actually depend on the feature and no longer require it: dEQP-VK.pipeline.multisample_shader_builtin.sample_mask.pattern.* dEQP-VK.pipeline.multisample_shader_builtin.sample_mask.write.* Affects: dEQP-VK.pipeline.multisample_shader_builtin.sample* Components: Vulkan VK-GL-CTS issue: 1745 Change-Id: Ib894149c9991edd10ae1961e7aaf6678eb0e6b5a --- ...lineMultisampleBaseResolveAndPerSampleFetch.cpp | 6 +- .../vktPipelineMultisampleShaderBuiltInTests.cpp | 69 +++++++++++++--------- 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolveAndPerSampleFetch.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolveAndPerSampleFetch.cpp index 0e9be3c..453fa03 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolveAndPerSampleFetch.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleBaseResolveAndPerSampleFetch.cpp @@ -82,11 +82,7 @@ void MSCaseBaseResolveAndPerSampleFetch::initPrograms (vk::SourceCollections& pr } MSInstanceBaseResolveAndPerSampleFetch::MSInstanceBaseResolveAndPerSampleFetch (Context& context, const ImageMSParams& imageMSParams) - : MultisampleInstanceBase(context, imageMSParams) -{ - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); -} + : MultisampleInstanceBase(context, imageMSParams) {} VkPipelineMultisampleStateCreateInfo MSInstanceBaseResolveAndPerSampleFetch::getMSStateCreateInfo (const ImageMSParams& imageMSParams) const { diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp index 1c8cb89..28d7ee9 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp @@ -197,18 +197,23 @@ template class MSInstance : public MSInstanceBaseResolveAndPerSampleFetch { public: - MSInstance (Context& context, - const ImageMSParams& imageMSParams) - : MSInstanceBaseResolveAndPerSampleFetch(context, imageMSParams) {} - - VertexDataDesc getVertexDataDescripton (void) const; - void uploadVertexData (const Allocation& vertexBufferAllocation, - const VertexDataDesc& vertexDataDescripton) const; - - tcu::TestStatus verifyImageData (const vk::VkImageCreateInfo& imageMSInfo, - const vk::VkImageCreateInfo& imageRSInfo, - const std::vector& dataPerSample, - const tcu::ConstPixelBufferAccess& dataRS) const; + MSInstance (Context& context, + const ImageMSParams& imageMSParams) + : MSInstanceBaseResolveAndPerSampleFetch(context, imageMSParams) {} + + VertexDataDesc getVertexDataDescripton (void) const; + void uploadVertexData (const Allocation& vertexBufferAllocation, + const VertexDataDesc& vertexDataDescripton) const; + + tcu::TestStatus verifyImageData (const vk::VkImageCreateInfo& imageMSInfo, + const vk::VkImageCreateInfo& imageRSInfo, + const std::vector& dataPerSample, + const tcu::ConstPixelBufferAccess& dataRS) const; + + virtual VkPipelineMultisampleStateCreateInfo getMSStateCreateInfo (const ImageMSParams& imageMSParams) const + { + return MSInstanceBaseResolveAndPerSampleFetch::getMSStateCreateInfo(imageMSParams); + } }; class MSInstanceSampleID; @@ -253,8 +258,7 @@ class MSCaseSampleID; template<> void MSCase::checkSupport (Context& context) const { - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING); } template<> void MSCase::init (void) @@ -406,8 +410,7 @@ class MSCaseSamplePosDistribution; template<> void MSCase::checkSupport (Context& context) const { - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING); } template<> void MSCase::init (void) @@ -498,8 +501,7 @@ class MSCaseSamplePosCorrectness; template<> void MSCase::checkSupport (Context& context) const { - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING); } template<> void MSCase::init (void) @@ -796,8 +798,7 @@ class MSCaseSampleMaskBitCount; template<> void MSCase::checkSupport (Context& context) const { - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING); } template<> void MSCase::init (void) @@ -891,8 +892,7 @@ class MSCaseSampleMaskCorrectBit; template<> void MSCase::checkSupport (Context& context) const { - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); + context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_SAMPLE_RATE_SHADING); } template<> void MSCase::init (void) @@ -962,6 +962,25 @@ template<> void MSInstance::uploadVertexData (const A uploadVertexDataNdc(vertexBufferAllocation, vertexDataDescripton); } +//! Creates VkPipelineMultisampleStateCreateInfo with sample shading disabled. +template<> VkPipelineMultisampleStateCreateInfo MSInstance::getMSStateCreateInfo (const ImageMSParams& imageMSParams) const +{ + const VkPipelineMultisampleStateCreateInfo multisampleStateInfo = + { + VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO, // VkStructureType sType; + DE_NULL, // const void* pNext; + (VkPipelineMultisampleStateCreateFlags)0u, // VkPipelineMultisampleStateCreateFlags flags; + imageMSParams.numSamples, // VkSampleCountFlagBits rasterizationSamples; + VK_FALSE, // VkBool32 sampleShadingEnable; + 0.0f, // float minSampleShading; + DE_NULL, // const VkSampleMask* pSampleMask; + VK_FALSE, // VkBool32 alphaToCoverageEnable; + VK_FALSE, // VkBool32 alphaToOneEnable; + }; + + return multisampleStateInfo; +} + template<> tcu::TestStatus MSInstance::verifyImageData (const vk::VkImageCreateInfo& imageMSInfo, const vk::VkImageCreateInfo& imageRSInfo, const std::vector& dataPerSample, @@ -997,12 +1016,6 @@ template<> tcu::TestStatus MSInstance::verifyImageDat class MSCaseSampleMaskWrite; -template<> void MSCase::checkSupport (Context& context) const -{ - if (!context.getDeviceFeatures().sampleRateShading) - TCU_THROW(NotSupportedError, "sampleRateShading not supported"); -} - template<> void MSCase::init (void) { m_testCtx.getLog() -- 2.7.4