Add missing checks for geometry shader support
authorRicardo Garcia <rgarcia@igalia.com>
Fri, 21 Oct 2022 14:19:52 +0000 (16:19 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 10 Nov 2022 18:39:42 +0000 (18:39 +0000)
Affects:
dEQP-VK.multiview.*geometry*
dEQP-VK.subgroups.*geometry*
dEQP-VK.fragment_shading_rate.*.gs*

VK-GL-CTS issue: 4064
Components: Vulkan

Change-Id: I64a3b6d7adc8da7671817710c4a4882db2c27035

external/vulkancts/modules/vulkan/fragment_shading_rate/vktFragmentShadingRateBasic.cpp
external/vulkancts/modules/vulkan/multiview/vktMultiViewRenderTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsTestsUtils.cpp

index 3b0f89a..e619204 100644 (file)
@@ -256,6 +256,9 @@ void FSRTestCase::checkSupport(Context& context) const
        if (result == VK_ERROR_FORMAT_NOT_SUPPORTED)
                TCU_THROW(NotSupportedError, "VK_FORMAT_R32G32B32A32_UINT not supported");
 
+       if (m_data.geometryShader)
+               context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
+
        if (!(imageProperties.sampleCounts & m_data.samples))
                TCU_THROW(NotSupportedError, "color buffer sample count not supported");
 
index d2a3215..2b544a2 100644 (file)
@@ -107,6 +107,13 @@ struct TestParameters
        VkSampleCountFlagBits   samples;
        VkFormat                                colorFormat;
        RenderingType                   renderingType;
+
+       bool geometryShaderNeeded (void) const
+       {
+               return ((TEST_TYPE_VIEW_INDEX_IN_GEOMETRY == viewIndex) ||
+                               (TEST_TYPE_INPUT_ATTACHMENTS_GEOMETRY == viewIndex) ||
+                               (TEST_TYPE_SECONDARY_CMD_BUFFER_GEOMETRY == viewIndex));
+       }
 };
 
 const int      TEST_POINT_SIZE_SMALL   = 2;
@@ -693,11 +700,7 @@ void MultiViewRenderTestInstance::createMultiViewDevices (void)
        if (!multiviewFeatures.multiview)
                TCU_THROW(NotSupportedError, "MultiView not supported");
 
-       bool requiresGeomShader = (TEST_TYPE_VIEW_INDEX_IN_GEOMETRY == m_parameters.viewIndex) ||
-                                                               (TEST_TYPE_INPUT_ATTACHMENTS_GEOMETRY == m_parameters.viewIndex) ||
-                                                               (TEST_TYPE_SECONDARY_CMD_BUFFER_GEOMETRY == m_parameters.viewIndex);
-
-       if (requiresGeomShader && !multiviewFeatures.multiviewGeometryShader)
+       if (m_parameters.geometryShaderNeeded() && !multiviewFeatures.multiviewGeometryShader)
                TCU_THROW(NotSupportedError, "Geometry shader is not supported");
 
        if (TEST_TYPE_VIEW_INDEX_IN_TESELLATION == m_parameters.viewIndex && !multiviewFeatures.multiviewTessellationShader)
@@ -3858,6 +3861,9 @@ private:
 
        virtual void            checkSupport            (Context& context) const
        {
+               if (m_parameters.geometryShaderNeeded())
+                       context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
+
                if (m_parameters.renderingType == RENDERING_TYPE_RENDERPASS2)
                        context.requireDeviceFunctionality("VK_KHR_create_renderpass2");
 
@@ -4006,9 +4012,7 @@ private:
                        programCollection.glslSources.add("tessellation_evaluation") << glu::TessellationEvaluationSource(source_te.str());
                }
 
-               if (TEST_TYPE_VIEW_INDEX_IN_GEOMETRY            == m_parameters.viewIndex ||
-                       TEST_TYPE_INPUT_ATTACHMENTS_GEOMETRY    == m_parameters.viewIndex ||
-                       TEST_TYPE_SECONDARY_CMD_BUFFER_GEOMETRY == m_parameters.viewIndex)
+               if (m_parameters.geometryShaderNeeded())
                {// Geometry Shader
                        std::ostringstream      source;
                        source  << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450)<<"\n"
index 81fce4d..2b9fb84 100644 (file)
@@ -4070,6 +4070,9 @@ void vkt::subgroups::supportedCheckShader (Context& context, const VkShaderStage
 {
        checkShaderStageSetValidity(shaderStages);
 
+       if ((shaderStages & VK_SHADER_STAGE_GEOMETRY_BIT) != 0)
+               context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_GEOMETRY_SHADER);
+
        if ((context.getSubgroupProperties().supportedStages & shaderStages) == 0)
        {
                if (isAllComputeStages(shaderStages))