Mix dynamic line stipple and dynamic primitive topology
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 9 Jun 2022 14:03:40 +0000 (16:03 +0200)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 16 Jun 2022 20:37:27 +0000 (20:37 +0000)
On some implementations, dynamic topology can interact with dynamic line
stipple, affecting the state of it. This commits adds a new set of tests
that set the dynamic line stipple values, then switch dynamic topologies
and draw using them before finally switching to the right topology again
and drawing, so as to check the dynamic topology changes have not
affected line stipple values.

New tests:
dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.*

Affected tests:
dEQP-VK.rasterization.*

Components: Vulkan
VK-GL-CTS issue: 3667

Change-Id: Ia1930186ef3a534280cf040e1cd706a460fd9765

android/cts/main/vk-master-2022-03-01/rasterization.txt
android/cts/main/vk-master/rasterization.txt
external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp
external/vulkancts/mustpass/main/vk-default/rasterization.txt

index 2b65dd5..f0379b2 100644 (file)
@@ -310,4 +310,20 @@ dEQP-VK.rasterization.primitives.no_stipple.smooth_lines_factor_large
 dEQP-VK.rasterization.primitives.no_stipple.smooth_line_strip_factor_large
 dEQP-VK.rasterization.primitives.no_stipple.smooth_lines_wide_factor_large
 dEQP-VK.rasterization.primitives.no_stipple.smooth_line_strip_wide_factor_large
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip_wide
 dEQP-VK.rasterization.culling.primitive_id
index 79d1f61..26e7d84 100644 (file)
@@ -757,6 +757,22 @@ dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_lines
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_line_strip
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_lines_wide
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip_wide
 dEQP-VK.rasterization.primitives.stride_zero.single_point
 dEQP-VK.rasterization.primitives.stride_zero.four_points
 dEQP-VK.rasterization.primitives.stride_zero.many_points
index aaf05aa..9d0ada9 100644 (file)
 #include "vkBufferWithMemory.hpp"
 #include "vkImageWithMemory.hpp"
 #include "vkBarrierUtil.hpp"
+#include "vkBufferWithMemory.hpp"
 #ifndef CTS_USES_VULKANSC
 #include "vktRasterizationOrderAttachmentAccessTests.hpp"
 #endif // CTS_USES_VULKANSC
 
 #include <vector>
 #include <sstream>
+#include <memory>
 
 using namespace vk;
 
@@ -75,7 +77,6 @@ using tcu::RasterizationArguments;
 using tcu::TriangleSceneSpec;
 using tcu::PointSceneSpec;
 using tcu::LineSceneSpec;
-using tcu::LineInterpolationMethod;
 
 static const char* const s_shaderVertexTemplate =      "#version 310 es\n"
                                                                                                        "layout(location = 0) in highp vec4 a_position;\n"
@@ -125,6 +126,7 @@ enum LineStipple
        LINESTIPPLE_DISABLED = 0,
        LINESTIPPLE_STATIC,
        LINESTIPPLE_DYNAMIC,
+       LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY,
 
        LINESTIPPLE_LAST
 };
@@ -200,6 +202,10 @@ protected:
        virtual float                                                                   getLineWidth                                    (void) const;
        virtual float                                                                   getPointSize                                    (void) const;
        virtual bool                                                                    getLineStippleDynamic                   (void) const { return false; }
+       virtual bool                                                                    isDynamicTopology                               (void) const { return false; }
+       virtual VkPrimitiveTopology                                             getWrongTopology                                (void) const { return VK_PRIMITIVE_TOPOLOGY_LAST; }
+       virtual VkPrimitiveTopology                                             getRightTopology                                (void) const { return VK_PRIMITIVE_TOPOLOGY_LAST; }
+       virtual std::vector<tcu::Vec4>                                  getOffScreenPoints                              (void) const { return std::vector<tcu::Vec4>(); }
 
        virtual
        const VkPipelineRasterizationStateCreateInfo*   getRasterizationStateCreateInfo (void) const;
@@ -681,12 +687,14 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
        const VkQueue                                                           queue                                   = m_context.getUniversalQueue();
        const deUint32                                                          queueFamilyIndex                = m_context.getUniversalQueueFamilyIndex();
        Allocator&                                                                      allocator                               = m_context.getDefaultAllocator();
-       const size_t                                                            attributeBatchSize              = positionData.size() * sizeof(tcu::Vec4);
+       const size_t                                                            attributeBatchSize              = de::dataSize(positionData);
+       const auto                                                                      offscreenData                   = getOffScreenPoints();
 
        Move<VkCommandBuffer>                                           commandBuffer;
        Move<VkPipeline>                                                        graphicsPipeline;
        Move<VkBuffer>                                                          vertexBuffer;
        de::MovePtr<Allocation>                                         vertexBufferMemory;
+       std::unique_ptr<BufferWithMemory>                       offscreenDataBuffer;
        const VkPhysicalDeviceProperties                        properties                              = m_context.getDeviceProperties();
 
        if (attributeBatchSize > properties.limits.maxVertexInputAttributeOffset)
@@ -765,11 +773,20 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
                        DE_NULL                                                                                                 // const VkDynamicState*                pDynamicStates
                };
 
-               VkDynamicState dynamicState = VK_DYNAMIC_STATE_LINE_STIPPLE_EXT;
+               std::vector<VkDynamicState> dynamicStates;
+
+               if (getLineStippleDynamic())
+                       dynamicStates.push_back(VK_DYNAMIC_STATE_LINE_STIPPLE_EXT);
+
+#ifndef CTS_USES_VULKANSC
+               if (isDynamicTopology())
+                       dynamicStates.push_back(VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY);
+#endif // CTS_USES_VULKANSC
+
                if (getLineStippleDynamic())
                {
-                       dynamicStateCreateInfo.dynamicStateCount = 1;
-                       dynamicStateCreateInfo.pDynamicStates = &dynamicState;
+                       dynamicStateCreateInfo.dynamicStateCount = static_cast<uint32_t>(dynamicStates.size());
+                       dynamicStateCreateInfo.pDynamicStates = de::dataOrNull(dynamicStates);
                }
 
                graphicsPipeline = makeGraphicsPipeline(vkd,                                                            // const DeviceInterface&                        vk
@@ -819,6 +836,26 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
                flushAlloc(vkd, vkDevice, *vertexBufferMemory);
        }
 
+       if (!offscreenData.empty())
+       {
+               // Concatenate positions with vertex colors.
+               const std::vector<tcu::Vec4>    colors                          (offscreenData.size(), tcu::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
+               std::vector<tcu::Vec4>                  fullOffscreenData       (offscreenData);
+               fullOffscreenData.insert(fullOffscreenData.end(), colors.begin(), colors.end());
+
+               // Copy full data to offscreen data buffer.
+               const auto offscreenBufferSizeSz        = de::dataSize(fullOffscreenData);
+               const auto offscreenBufferSize          = static_cast<VkDeviceSize>(offscreenBufferSizeSz);
+               const auto offscreenDataCreateInfo      = makeBufferCreateInfo(offscreenBufferSize, VK_BUFFER_USAGE_VERTEX_BUFFER_BIT);
+
+               offscreenDataBuffer     .reset(new BufferWithMemory(vkd, vkDevice, allocator, offscreenDataCreateInfo, MemoryRequirement::HostVisible));
+               auto& bufferAlloc       = offscreenDataBuffer->getAllocation();
+               void* dataPtr           = bufferAlloc.getHostPtr();
+
+               deMemcpy(dataPtr, fullOffscreenData.data(), offscreenBufferSizeSz);
+               flushAlloc(vkd, vkDevice, bufferAlloc);
+       }
+
        // Create Command Buffer
        commandBuffer = allocateCommandBuffer(vkd, vkDevice, *m_commandPool, VK_COMMAND_BUFFER_LEVEL_PRIMARY);
 
@@ -850,9 +887,25 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
 
        vkd.cmdBindPipeline(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *graphicsPipeline);
        vkd.cmdBindDescriptorSets(*commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, *m_pipelineLayout, 0u, 1, &m_descriptorSet.get(), 0u, DE_NULL);
-       vkd.cmdBindVertexBuffers(*commandBuffer, 0, 1, &vertexBuffer.get(), &vertexBufferOffset);
        if (getLineStippleDynamic())
+       {
                vkd.cmdSetLineStippleEXT(*commandBuffer, lineStippleFactor, lineStipplePattern);
+#ifndef CTS_USES_VULKANSC
+               if (isDynamicTopology())
+               {
+                       // Using a dynamic topology can interact with the dynamic line stipple set above on some implementations, so we try to
+                       // check nothing breaks here. We set a wrong topology, draw some offscreen data and go back to the right topology
+                       // _without_ re-setting the line stipple again. Side effects should not be visible.
+                       DE_ASSERT(!!offscreenDataBuffer);
+
+                       vkd.cmdSetPrimitiveTopology(*commandBuffer, getWrongTopology());
+                       vkd.cmdBindVertexBuffers(*commandBuffer, 0, 1, &offscreenDataBuffer->get(), &vertexBufferOffset);
+                       vkd.cmdDraw(*commandBuffer, static_cast<uint32_t>(offscreenData.size()), 1u, 0u, 0u);
+                       vkd.cmdSetPrimitiveTopology(*commandBuffer, getRightTopology());
+               }
+#endif // CTS_USES_VULKANSC
+       }
+       vkd.cmdBindVertexBuffers(*commandBuffer, 0, 1, &vertexBuffer.get(), &vertexBufferOffset);
        vkd.cmdDraw(*commandBuffer, (deUint32)positionData.size(), 1, 0, 0);
        endRenderPass(vkd, *commandBuffer);
 
@@ -1067,7 +1120,11 @@ public:
        virtual tcu::TestStatus         iterate                                 (void);
        virtual float                           getLineWidth                    (void) const;
        bool                                            getLineStippleEnable    (void) const { return m_stipple != LINESTIPPLE_DISABLED; }
-       virtual bool                            getLineStippleDynamic   (void) const { return m_stipple == LINESTIPPLE_DYNAMIC; }
+       virtual bool                            getLineStippleDynamic   (void) const { return (m_stipple == LINESTIPPLE_DYNAMIC || m_stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY); }
+       virtual bool                            isDynamicTopology               (void) const { return m_stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY; }
+
+       virtual
+       std::vector<tcu::Vec4>          getOffScreenPoints              (void) const;
 
        virtual
        VkPipelineRasterizationLineStateCreateInfoEXT   initLineRasterizationStateCreateInfo    (void) const;
@@ -1517,6 +1574,19 @@ float BaseLineTestInstance::getLineWidth (void) const
        return m_lineWidths[m_iteration];
 }
 
+std::vector<tcu::Vec4> BaseLineTestInstance::getOffScreenPoints (void) const
+{
+       // These points will be used to draw something with the wrong topology.
+       // They are offscreen so as not to affect the render result.
+       return std::vector<tcu::Vec4>
+       {
+               tcu::Vec4(2.0f, 2.0f, 0.0f, 1.0f),
+               tcu::Vec4(2.0f, 3.0f, 0.0f, 1.0f),
+               tcu::Vec4(2.0f, 4.0f, 0.0f, 1.0f),
+               tcu::Vec4(2.0f, 5.0f, 0.0f, 1.0f),
+       };
+}
+
 VkPipelineRasterizationLineStateCreateInfoEXT BaseLineTestInstance::initLineRasterizationStateCreateInfo (void) const
 {
        VkPipelineRasterizationLineStateCreateInfoEXT lineRasterizationStateInfo        =
@@ -4486,6 +4556,9 @@ public:
                                                                {
                                                                        if (m_isLineTest)
                                                                        {
+                                                                               if (m_stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY)
+                                                                                       context.requireDeviceFunctionality("VK_EXT_extended_dynamic_state");
+
                                                                                if (m_wideness == PRIMITIVEWIDENESS_WIDE)
                                                                                        context.requireDeviceCoreFeature(DEVICE_CORE_FEATURE_WIDE_LINES);
 
@@ -4560,7 +4633,6 @@ public:
                                                                }
 
        bool                                    getLineStippleEnable    (void) const { return m_stipple != LINESTIPPLE_DISABLED; }
-       virtual bool                    getLineStippleDynamic   (void) const { return m_stipple == LINESTIPPLE_DYNAMIC; }
 
 protected:
        const PrimitiveWideness                         m_wideness;
@@ -4575,11 +4647,14 @@ protected:
 class LinesTestInstance : public BaseLineTestInstance
 {
 public:
-                                                               LinesTestInstance       (Context& context, PrimitiveWideness wideness, PrimitiveStrictness strictness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, LineStippleFactorCase stippleFactor, deUint32 additionalRenderSize = 0)
-                                                                       : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_LIST, wideness, strictness, sampleCount, stipple, lineRasterizationMode, stippleFactor, additionalRenderSize)
-                                                               {}
+                                               LinesTestInstance       (Context& context, PrimitiveWideness wideness, PrimitiveStrictness strictness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, LineStippleFactorCase stippleFactor, deUint32 additionalRenderSize = 0)
+                                                       : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_LIST, wideness, strictness, sampleCount, stipple, lineRasterizationMode, stippleFactor, additionalRenderSize)
+                                               {}
+
+       VkPrimitiveTopology     getWrongTopology        (void) const override { return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; }
+       VkPrimitiveTopology     getRightTopology        (void) const override { return VK_PRIMITIVE_TOPOLOGY_LINE_LIST; }
+       void                            generateLines           (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines) override;
 
-       virtual void                            generateLines           (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines);
 };
 
 void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines)
@@ -4649,11 +4724,13 @@ void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& ou
 class LineStripTestInstance : public BaseLineTestInstance
 {
 public:
-                                       LineStripTestInstance   (Context& context, PrimitiveWideness wideness, PrimitiveStrictness strictness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, LineStippleFactorCase stippleFactor, deUint32)
-                                               : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, wideness, strictness, sampleCount, stipple, lineRasterizationMode, stippleFactor)
-                                       {}
+                                               LineStripTestInstance   (Context& context, PrimitiveWideness wideness, PrimitiveStrictness strictness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, LineStippleFactorCase stippleFactor, deUint32)
+                                                       : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, wideness, strictness, sampleCount, stipple, lineRasterizationMode, stippleFactor)
+                                               {}
 
-       virtual void    generateLines                   (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines);
+       VkPrimitiveTopology     getWrongTopology                (void) const override { return VK_PRIMITIVE_TOPOLOGY_LINE_LIST; }
+       VkPrimitiveTopology     getRightTopology                (void) const override { return VK_PRIMITIVE_TOPOLOGY_LINE_STRIP; }
+       void                            generateLines                   (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines) override;
 };
 
 void LineStripTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines)
@@ -6861,11 +6938,17 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
                tcu::TestCaseGroup* const nostippleTests = new tcu::TestCaseGroup(testCtx, "no_stipple", "No stipple");
                tcu::TestCaseGroup* const stippleStaticTests = new tcu::TestCaseGroup(testCtx, "static_stipple", "Line stipple static");
                tcu::TestCaseGroup* const stippleDynamicTests = new tcu::TestCaseGroup(testCtx, "dynamic_stipple", "Line stipple dynamic");
+#ifndef CTS_USES_VULKANSC
+               tcu::TestCaseGroup* const stippleDynamicTopoTests = new tcu::TestCaseGroup(testCtx, "dynamic_stipple_and_topology", "Dynamic line stipple and topology");
+#endif // CTS_USES_VULKANSC
                tcu::TestCaseGroup* const strideZeroTests = new tcu::TestCaseGroup(testCtx, "stride_zero", "Test input assembly with stride zero");
 
                primitives->addChild(nostippleTests);
                primitives->addChild(stippleStaticTests);
                primitives->addChild(stippleDynamicTests);
+#ifndef CTS_USES_VULKANSC
+               primitives->addChild(stippleDynamicTopoTests);
+#endif // CTS_USES_VULKANSC
                primitives->addChild(strideZeroTests);
 
                // .stride_zero
@@ -6908,12 +6991,27 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
                nostippleTests->addChild(new WidenessTestCase<LinesTestInstance>                (testCtx, "non_strict_lines_wide",              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST in nonstrict mode with wide lines, verify rasterization result",  PRIMITIVEWIDENESS_WIDE,         PRIMITIVESTRICTNESS_NONSTRICT, true, VK_SAMPLE_COUNT_1_BIT, LINESTIPPLE_DISABLED, VK_LINE_RASTERIZATION_MODE_EXT_LAST));
                nostippleTests->addChild(new WidenessTestCase<LineStripTestInstance>    (testCtx, "non_strict_line_strip_wide", "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_STRIP in nonstrict mode with wide lines, verify rasterization result", PRIMITIVEWIDENESS_WIDE,         PRIMITIVESTRICTNESS_NONSTRICT, true, VK_SAMPLE_COUNT_1_BIT, LINESTIPPLE_DISABLED, VK_LINE_RASTERIZATION_MODE_EXT_LAST));
 
-               for (int i = 0; i < 3; ++i) {
-
-                       tcu::TestCaseGroup *g = i == 2 ? stippleDynamicTests : i == 1 ? stippleStaticTests : nostippleTests;
+               for (int i = 0; i < static_cast<int>(LINESTIPPLE_LAST); ++i) {
 
                        LineStipple stipple = (LineStipple)i;
 
+#ifdef CTS_USES_VULKANSC
+                       if (stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY)
+                               continue;
+#endif // CTS_USES_VULKANSC
+
+                       tcu::TestCaseGroup *g   = (stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY)
+#ifndef CTS_USES_VULKANSC
+                                                                       ? stippleDynamicTopoTests
+#else
+                                                                       ? nullptr // Note this is actually unused, due to the continue statement above.
+#endif // CTS_USES_VULKANSC
+                                                                       : (stipple == LINESTIPPLE_DYNAMIC)
+                                                                       ? stippleDynamicTests
+                                                                       : (stipple == LINESTIPPLE_STATIC)
+                                                                       ? stippleStaticTests
+                                                                       : nostippleTests;
+
                        for (const auto& sfCase : stippleFactorCases)
                        {
                                if (sfCase.stippleFactor != LineStippleFactorCase::DEFAULT && stipple != LINESTIPPLE_DISABLED)
@@ -7496,12 +7594,20 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
                        nostippleTests->addChild(new WidenessTestCase<LinesTestInstance>                (testCtx, "non_strict_lines",           "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST in nonstrict mode, verify rasterization result",                                          PRIMITIVEWIDENESS_NARROW,       PRIMITIVESTRICTNESS_NONSTRICT,  true, samples[samplesNdx], LINESTIPPLE_DISABLED, VK_LINE_RASTERIZATION_MODE_EXT_LAST));
                        nostippleTests->addChild(new WidenessTestCase<LinesTestInstance>                (testCtx, "non_strict_lines_wide",      "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST in nonstrict mode with wide lines, verify rasterization result",          PRIMITIVEWIDENESS_WIDE,         PRIMITIVESTRICTNESS_NONSTRICT,  true, samples[samplesNdx], LINESTIPPLE_DISABLED, VK_LINE_RASTERIZATION_MODE_EXT_LAST));
 
-                       for (int i = 0; i < 3; ++i) {
-
-                               tcu::TestCaseGroup *g = i == 2 ? stippleDynamicTests : i == 1 ? stippleStaticTests : nostippleTests;
+                       for (int i = 0; i < static_cast<int>(LINESTIPPLE_LAST); ++i) {
 
                                LineStipple stipple = (LineStipple)i;
 
+                               // These variants are not needed for multisample cases.
+                               if (stipple == LINESTIPPLE_DYNAMIC_WITH_TOPOLOGY)
+                                       continue;
+
+                               tcu::TestCaseGroup *g   = (stipple == LINESTIPPLE_DYNAMIC)
+                                                                               ? stippleDynamicTests
+                                                                               : (stipple == LINESTIPPLE_STATIC)
+                                                                               ? stippleStaticTests
+                                                                               : nostippleTests;
+
                                g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines",                                              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST, verify rasterization result",                                            PRIMITIVEWIDENESS_NARROW,       PRIMITIVESTRICTNESS_IGNORE, true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT, LineStippleFactorCase::DEFAULT, i == 0 ? RESOLUTION_NPOT : 0));
                                g->addChild(new WidenessTestCase<LineStripTestInstance> (testCtx, "line_strip",                                 "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, verify rasterization result",                                           PRIMITIVEWIDENESS_NARROW,       PRIMITIVESTRICTNESS_IGNORE, true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
                                g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines_wide",                                 "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST with wide lines, verify rasterization result",            PRIMITIVEWIDENESS_WIDE,         PRIMITIVESTRICTNESS_IGNORE, true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
index 8d3b688..9c7fac1 100644 (file)
@@ -757,6 +757,22 @@ dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_lines
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_line_strip
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_lines_wide
 dEQP-VK.rasterization.primitives.dynamic_stipple.smooth_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.rectangular_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.bresenham_line_strip_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_lines_wide
+dEQP-VK.rasterization.primitives.dynamic_stipple_and_topology.smooth_line_strip_wide
 dEQP-VK.rasterization.primitives.stride_zero.single_point
 dEQP-VK.rasterization.primitives.stride_zero.four_points
 dEQP-VK.rasterization.primitives.stride_zero.many_points