Invalid VkPipelineRasterizationLineStateCreateInfoEXT chained
authorBoris Zanin <boris.zanin@mobica.com>
Thu, 27 May 2021 13:36:30 +0000 (15:36 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 3 Jun 2021 08:56:10 +0000 (08:56 +0000)
Some tests get the structure empty (and implementations most
likely ignore it), other tests get the structure with fields
inadequate to the test.

Update tests:
 * dEQP-VK.rasterization.*

Components: Vulkan

VK-GL-CTS issue: 2942

Change-Id: Ie485ad55266a53e64c74eab3db31a51d781c9d57

external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp

index b6f37bf..b66856b 100644 (file)
@@ -195,7 +195,7 @@ protected:
        VkPipelineRasterizationLineStateCreateInfoEXT   initLineRasterizationStateCreateInfo    (void) const;
 
        virtual
-       const VkPipelineRasterizationLineStateCreateInfoEXT*    getLineRasterizationStateCreateInfo     (void) const;
+       const VkPipelineRasterizationLineStateCreateInfoEXT*    getLineRasterizationStateCreateInfo     (void);
 
        virtual
        const VkPipelineColorBlendStateCreateInfo*              getColorBlendStateCreateInfo    (void) const;
@@ -260,7 +260,7 @@ BaseRenderingTestInstance::BaseRenderingTestInstance (Context& context, VkSample
        , m_resultBufferSize    (renderSize * renderSize * m_textureFormat.getPixelSize())
        , m_additionalRenderSize(additionalRenderSize)
        , m_additionalResultBufferSize(additionalRenderSize * additionalRenderSize * m_textureFormat.getPixelSize())
-       , m_lineRasterizationStateInfo  (initLineRasterizationStateCreateInfo())
+       , m_lineRasterizationStateInfo  ()
 {
        const DeviceInterface&                                          vkd                                             = m_context.getDeviceInterface();
        const VkDevice                                                          vkDevice                                = m_context.getDevice();
@@ -269,8 +269,6 @@ BaseRenderingTestInstance::BaseRenderingTestInstance (Context& context, VkSample
        DescriptorPoolBuilder                                           descriptorPoolBuilder;
        DescriptorSetLayoutBuilder                                      descriptorSetLayoutBuilder;
 
-       deMemset(&m_lineRasterizationStateInfo, 0, sizeof(m_lineRasterizationStateInfo));
-
        // Command Pool
        m_commandPool = createCommandPool(vkd, vkDevice, VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT, queueFamilyIndex);
 
@@ -912,8 +910,11 @@ VkPipelineRasterizationLineStateCreateInfoEXT BaseRenderingTestInstance::initLin
        return lineRasterizationStateInfo;
 }
 
-const VkPipelineRasterizationLineStateCreateInfoEXT* BaseRenderingTestInstance::getLineRasterizationStateCreateInfo (void) const
+const VkPipelineRasterizationLineStateCreateInfoEXT* BaseRenderingTestInstance::getLineRasterizationStateCreateInfo (void)
 {
+       if (m_lineRasterizationStateInfo.sType != VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT)
+               m_lineRasterizationStateInfo = initLineRasterizationStateCreateInfo();
+
        return &m_lineRasterizationStateInfo;
 }
 
@@ -1058,7 +1059,7 @@ public:
        VkPipelineRasterizationLineStateCreateInfoEXT   initLineRasterizationStateCreateInfo    (void) const;
 
        virtual
-       const VkPipelineRasterizationLineStateCreateInfoEXT*    getLineRasterizationStateCreateInfo     (void) const;
+       const VkPipelineRasterizationLineStateCreateInfoEXT*    getLineRasterizationStateCreateInfo     (void);
 
 protected:
        int                                                     getIteration                    (void) const    { return m_iteration;           }
@@ -1118,8 +1119,6 @@ BaseLineTestInstance::BaseLineTestInstance (Context&                                      context,
 {
        DE_ASSERT(m_primitiveWideness < PRIMITIVEWIDENESS_LAST);
 
-       m_lineRasterizationStateInfo = initLineRasterizationStateCreateInfo();
-
        if (m_lineRasterizationMode != VK_LINE_RASTERIZATION_MODE_EXT_LAST)
        {
                if (context.isDeviceFunctionalitySupported("VK_EXT_line_rasterization"))
@@ -1520,11 +1519,14 @@ VkPipelineRasterizationLineStateCreateInfoEXT BaseLineTestInstance::initLineRast
        return lineRasterizationStateInfo;
 }
 
-const VkPipelineRasterizationLineStateCreateInfoEXT* BaseLineTestInstance::getLineRasterizationStateCreateInfo (void) const
+const VkPipelineRasterizationLineStateCreateInfoEXT* BaseLineTestInstance::getLineRasterizationStateCreateInfo (void)
 {
        if (m_lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_EXT_LAST)
                return DE_NULL;
 
+       if (m_lineRasterizationStateInfo.sType != VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_LINE_STATE_CREATE_INFO_EXT)
+               m_lineRasterizationStateInfo = initLineRasterizationStateCreateInfo();
+
        return &m_lineRasterizationStateInfo;
 }
 
@@ -2471,7 +2473,7 @@ public:
        const VkPipelineRasterizationStateCreateInfo*                                                           getRasterizationStateCreateInfo                                 (void) const;
 
 protected:
-       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void) const;
+       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void);
 
        virtual bool                                                                                                                            compareAndVerify                                                                (std::vector<TriangleSceneSpec::SceneTriangle>& triangles,
                                                                                                                                                                                                                                                                 tcu::Surface&                                                                  resultImage,
@@ -3209,7 +3211,7 @@ const VkPipelineRasterizationStateCreateInfo* ConservativeTraingleTestInstance::
        return &m_rasterizationStateCreateInfo[getIteration()];
 }
 
-const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativeTraingleTestInstance::getLineRasterizationStateCreateInfo     (void) const
+const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativeTraingleTestInstance::getLineRasterizationStateCreateInfo     (void)
 {
        return DE_NULL;
 }
@@ -3228,7 +3230,7 @@ public:
        const VkPipelineRasterizationStateCreateInfo*                                                           getRasterizationStateCreateInfo                                 (void) const;
 
 protected:
-       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void) const;
+       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void);
 
        virtual bool                                                                                                                            compareAndVerify                                                                (std::vector<LineSceneSpec::SceneLine>& lines,
                                                                                                                                                                                                                                                                 tcu::Surface&                                                  resultImage,
@@ -3964,7 +3966,7 @@ const VkPipelineRasterizationStateCreateInfo* ConservativeLineTestInstance::getR
        return &m_rasterizationStateCreateInfo[getIteration()];
 }
 
-const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativeLineTestInstance::getLineRasterizationStateCreateInfo (void) const
+const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativeLineTestInstance::getLineRasterizationStateCreateInfo (void)
 {
        return DE_NULL;
 }
@@ -4001,7 +4003,7 @@ public:
        const VkPipelineRasterizationStateCreateInfo*                                                           getRasterizationStateCreateInfo                                 (void) const;
 
 protected:
-       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void) const;
+       virtual const VkPipelineRasterizationLineStateCreateInfoEXT*                            getLineRasterizationStateCreateInfo                             (void);
 
        virtual bool                                                                                                                            compareAndVerify                                                                (std::vector<PointSceneSpec::ScenePoint>&       points,
                                                                                                                                                                                                                                                                 tcu::Surface&                                                          resultImage,
@@ -4401,7 +4403,7 @@ const VkPipelineRasterizationStateCreateInfo* ConservativePointTestInstance::get
        return &m_rasterizationStateCreateInfo[getIteration()];
 }
 
-const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativePointTestInstance::getLineRasterizationStateCreateInfo        (void) const
+const VkPipelineRasterizationLineStateCreateInfoEXT* ConservativePointTestInstance::getLineRasterizationStateCreateInfo        (void)
 {
        return DE_NULL;
 }