From 9e53777781b4ffb97a61fb3323c2b5de259e5a80 Mon Sep 17 00:00:00 2001 From: Toni Merilehti Date: Wed, 15 May 2019 17:49:42 +0300 Subject: [PATCH] Add feature checks to shader builtin tests Some shader builtin tests use SampleId and SamplePosition BuiltIns in shaders, which both require the SampleRateShading OpCapability and the sampleRateShading Vulkan feature. This CL adds the missing feature checks when required by the shaders. Affects: dEQP-VK.pipeline.multisample_shader_builtin.sample_id.* dEQP-VK.pipeline.multisample_shader_builtin.sample_position.* Components: Vulkan VK-GL-CTS issue: 1744 Change-Id: I4557b5cd79191f7ca1202562416d12d3b1d8ce60 (cherry picked from commit 3f2ce1e5bcf568fe0a65a4ed638e0589b8694482) --- .../vktPipelineMultisampleShaderBuiltInTests.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp index 68458d5..18a12ee 100644 --- a/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp +++ b/external/vulkancts/modules/vulkan/pipeline/vktPipelineMultisampleShaderBuiltInTests.cpp @@ -175,6 +175,7 @@ public: const ImageMSParams& imageMSParams) : MSCaseBaseResolveAndPerSampleFetch(testCtx, name, imageMSParams) {} + virtual void checkSupport (Context&) const {} void init (void); void initPrograms (vk::SourceCollections& programCollection) const; TestInstance* createInstance (Context& context) const; @@ -247,6 +248,12 @@ template<> tcu::TestStatus MSInstance::verifyImageData (cons class MSCaseSampleID; +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() @@ -394,6 +401,12 @@ template<> tcu::TestStatus MSInstance::verifyIm class MSCaseSamplePosDistribution; +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() @@ -480,6 +493,12 @@ template<> tcu::TestStatus MSInstance::verifyIma class MSCaseSamplePosCorrectness; +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