Extend rasterization testing, modify verification
authorMike Byrne <mike.byrne@arm.com>
Mon, 13 May 2019 14:15:02 +0000 (15:15 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 3 Dec 2019 18:44:25 +0000 (13:44 -0500)
dEQP-VK.rasterization.primitives.lines tests are extended to add tests
drawing vertical and horizontal lines.

Extend dEQP-VK.rasterization.primitives.lines and
dEQP-VK.rasterization.primitives_multisample_n_bit.lines to test at 258
resolution (a non power of two resolution).

The strict line verification coverage is modified to allow checking of
vertical and horizontal lines. Previously pixels in vertical or hori-
zontal lines were marked as partially covered and hence the test did
not detect whether the lines were rendered correctly or not.

Affects: dEQP-VK.rasterization.primitives*

Components: Vulkan

VK-GL-CTS Issue: 2062

Change-Id: Ifb76a44ba1ebdc97353bbd1a4b2552e415f2723d

external/vulkancts/modules/vulkan/rasterization/vktRasterizationTests.cpp
framework/common/tcuRasterizationVerifier.cpp
framework/common/tcuRasterizationVerifier.hpp

index db46bfa..170c156 100644 (file)
@@ -92,6 +92,12 @@ enum InterpolationCaseFlags
        INTERPOLATIONFLAGS_FLATSHADE = (1 << 2),
 };
 
+enum ResolutionValues
+{
+       RESOLUTION_POT = 256,
+       RESOLUTION_NPOT = 258
+};
+
 enum PrimitiveWideness
 {
        PRIMITIVEWIDENESS_NARROW = 0,
@@ -151,17 +157,15 @@ BaseRenderingTestCase::~BaseRenderingTestCase (void)
 class BaseRenderingTestInstance : public TestInstance
 {
 public:
-       enum {
-               DEFAULT_RENDER_SIZE = 256
-       };
-
-                                                                                                       BaseRenderingTestInstance               (Context& context, VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT, deUint32 renderSize = DEFAULT_RENDER_SIZE, VkFormat imageFormat = VK_FORMAT_R8G8B8A8_UNORM);
+                                                                                                       BaseRenderingTestInstance               (Context& context, VkSampleCountFlagBits sampleCount = VK_SAMPLE_COUNT_1_BIT, deUint32 renderSize = RESOLUTION_POT, VkFormat imageFormat = VK_FORMAT_R8G8B8A8_UNORM, deUint32 additionalRenderSize = 0);
                                                                                                        ~BaseRenderingTestInstance              (void);
 
 protected:
        void                                                                                    addImageTransitionBarrier               (VkCommandBuffer commandBuffer, VkImage image, VkPipelineStageFlags srcStageMask, VkPipelineStageFlags dstStageMask, VkAccessFlags srcAccessMask, VkAccessFlags dstAccessMask, VkImageLayout oldLayout, VkImageLayout newLayout) const;
        void                                                                                    drawPrimitives                                  (tcu::Surface& result, const std::vector<tcu::Vec4>& vertexData, VkPrimitiveTopology primitiveTopology);
        void                                                                                    drawPrimitives                                  (tcu::Surface& result, const std::vector<tcu::Vec4>& vertexData, const std::vector<tcu::Vec4>& coloDrata, VkPrimitiveTopology primitiveTopology);
+       void                                                                                    drawPrimitives                                  (tcu::Surface& result, const std::vector<tcu::Vec4>& positionData, const std::vector<tcu::Vec4>& colorData, VkPrimitiveTopology primitiveTopology,
+                                                                                                                                                                               VkImage image, VkImage resolvedImage, VkFramebuffer frameBuffer, const deUint32 renderSize, VkBuffer resultBuffer, const Allocation& resultBufferMemory);
        virtual float                                                                   getLineWidth                                    (void) const;
        virtual float                                                                   getPointSize                                    (void) const;
        virtual bool                                                                    getLineStippleDynamic                   (void) const { return false; };
@@ -213,9 +217,12 @@ protected:
        Move<VkBuffer>                                                                  m_resultBuffer;
        de::MovePtr<Allocation>                                                 m_resultBufferMemory;
        const VkDeviceSize                                                              m_resultBufferSize;
+
+       const deUint32                                                                  m_additionalRenderSize;
+       const VkDeviceSize                                                              m_additionalResultBufferSize;
 };
 
-BaseRenderingTestInstance::BaseRenderingTestInstance (Context& context, VkSampleCountFlagBits sampleCount, deUint32 renderSize, VkFormat imageFormat)
+BaseRenderingTestInstance::BaseRenderingTestInstance (Context& context, VkSampleCountFlagBits sampleCount, deUint32 renderSize, VkFormat imageFormat, deUint32 additionalRenderSize)
        : TestInstance                  (context)
        , m_renderSize                  (renderSize)
        , m_sampleCount                 (sampleCount)
@@ -225,6 +232,8 @@ BaseRenderingTestInstance::BaseRenderingTestInstance (Context& context, VkSample
        , m_textureFormat               (vk::mapVkFormat(m_imageFormat))
        , m_uniformBufferSize   (sizeof(float))
        , m_resultBufferSize    (renderSize * renderSize * m_textureFormat.getPixelSize())
+       , m_additionalRenderSize(additionalRenderSize)
+       , m_additionalResultBufferSize(additionalRenderSize * additionalRenderSize * m_textureFormat.getPixelSize())
 {
        const DeviceInterface&                                          vkd                                             = m_context.getDeviceInterface();
        const VkDevice                                                          vkDevice                                = m_context.getDevice();
@@ -622,6 +631,11 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
 
 void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std::vector<tcu::Vec4>& positionData, const std::vector<tcu::Vec4>& colorData, VkPrimitiveTopology primitiveTopology)
 {
+       drawPrimitives(result, positionData, colorData, primitiveTopology, *m_image, *m_resolvedImage, *m_frameBuffer, m_renderSize, *m_resultBuffer, *m_resultBufferMemory);
+}
+void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std::vector<tcu::Vec4>& positionData, const std::vector<tcu::Vec4>& colorData, VkPrimitiveTopology primitiveTopology,
+                                       VkImage image, VkImage resolvedImage, VkFramebuffer frameBuffer, const deUint32 renderSize, VkBuffer resultBuffer, const Allocation& resultBufferMemory)
+{
        const DeviceInterface&                                          vkd                                             = m_context.getDeviceInterface();
        const VkDevice                                                          vkDevice                                = m_context.getDevice();
        const VkQueue                                                           queue                                   = m_context.getUniversalQueue();
@@ -678,8 +692,8 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
                        vertexInputAttributeDescriptions                                                                // const VkVertexInputAttributeDescription*     pVertexAttributeDescriptions;
                };
 
-               const std::vector<VkViewport>   viewports       (1, makeViewport(tcu::UVec2(m_renderSize)));
-               const std::vector<VkRect2D>             scissors        (1, makeRect2D(tcu::UVec2(m_renderSize)));
+               const std::vector<VkViewport>   viewports       (1, makeViewport(tcu::UVec2(renderSize)));
+               const std::vector<VkRect2D>             scissors        (1, makeRect2D(tcu::UVec2(renderSize)));
 
                const VkPipelineMultisampleStateCreateInfo multisampleStateParams =
                {
@@ -770,7 +784,7 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
        // Begin Command Buffer
        beginCommandBuffer(vkd, *commandBuffer);
 
-       addImageTransitionBarrier(*commandBuffer, *m_image,
+       addImageTransitionBarrier(*commandBuffer, image,
                                                          VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                            // VkPipelineStageFlags         srcStageMask
                                                          VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,                           // VkPipelineStageFlags         dstStageMask
                                                          0,                                                                                            // VkAccessFlags                        srcAccessMask
@@ -779,7 +793,7 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
                                                          VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL);            // VkImageLayout                        newLayout;
 
        if (m_multisampling) {
-               addImageTransitionBarrier(*commandBuffer, *m_resolvedImage,
+               addImageTransitionBarrier(*commandBuffer, resolvedImage,
                                                                  VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT,                            // VkPipelineStageFlags         srcStageMask
                                                                  VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,                           // VkPipelineStageFlags         dstStageMask
                                                                  0,                                                                                            // VkAccessFlags                        srcAccessMask
@@ -789,7 +803,7 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
        }
 
        // Begin Render Pass
-       beginRenderPass(vkd, *commandBuffer, *m_renderPass, *m_frameBuffer, vk::makeRect2D(0, 0, m_renderSize, m_renderSize), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
+       beginRenderPass(vkd, *commandBuffer, *m_renderPass, frameBuffer, vk::makeRect2D(0, 0, renderSize, renderSize), tcu::Vec4(0.0f, 0.0f, 0.0f, 1.0f));
 
        const VkDeviceSize                                              vertexBufferOffset              = 0;
 
@@ -802,7 +816,7 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
        endRenderPass(vkd, *commandBuffer);
 
        // Copy Image
-       copyImageToBuffer(vkd, *commandBuffer, m_multisampling ? *m_resolvedImage : *m_image, *m_resultBuffer, tcu::IVec2(m_renderSize, m_renderSize));
+       copyImageToBuffer(vkd, *commandBuffer, m_multisampling ? resolvedImage : image, resultBuffer, tcu::IVec2(renderSize, renderSize));
 
        endCommandBuffer(vkd, *commandBuffer);
 
@@ -816,8 +830,8 @@ void BaseRenderingTestInstance::drawPrimitives (tcu::Surface& result, const std:
        // Submit
        submitCommandsAndWait(vkd, vkDevice, queue, commandBuffer.get());
 
-       invalidateAlloc(vkd, vkDevice, *m_resultBufferMemory);
-       tcu::copy(result.getAccess(), tcu::ConstPixelBufferAccess(m_textureFormat, tcu::IVec3(m_renderSize, m_renderSize, 1), m_resultBufferMemory->getHostPtr()));
+       invalidateAlloc(vkd, vkDevice, resultBufferMemory);
+       tcu::copy(result.getAccess(), tcu::ConstPixelBufferAccess(m_textureFormat, tcu::IVec3(renderSize, renderSize, 1), resultBufferMemory.getHostPtr()));
 }
 
 float BaseRenderingTestInstance::getLineWidth (void) const
@@ -984,7 +998,8 @@ public:
                                                                                                         PrimitiveWideness wideness,
                                                                                                         VkSampleCountFlagBits sampleCount,
                                                                                                         LineStipple stipple,
-                                                                                                        VkLineRasterizationModeEXT     lineRasterizationMode);
+                                                                                                        VkLineRasterizationModeEXT     lineRasterizationMode,
+                                                                                                        const deUint32 additionalRenderSize = 0);
        virtual tcu::TestStatus iterate                                 (void);
        virtual float                   getLineWidth                    (void) const;
        bool                                    getLineStippleEnable    (void) const { return m_stipple != LINESTIPPLE_DISABLED; }
@@ -996,6 +1011,8 @@ public:
 private:
        virtual void                    generateLines                   (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines) = DE_NULL;
 
+       bool                                    resultHasAlpha                  (tcu::Surface& result);
+
        int                                             m_iteration;
        const int                               m_iterationCount;
        VkPrimitiveTopology             m_primitiveTopology;
@@ -1006,6 +1023,15 @@ private:
        std::vector<float>              m_lineWidths;
        LineStipple                             m_stipple;
        VkLineRasterizationModeEXT      m_lineRasterizationMode;
+       Move<VkImage>                                                                   m_additionalImage;
+       de::MovePtr<Allocation>                                                 m_additionalImageMemory;
+       Move<VkImageView>                                                               m_additionalImageView;
+       Move<VkImage>                                                                   m_additionalResolvedImage;
+       de::MovePtr<Allocation>                                                 m_additionalResolvedImageMemory;
+       Move<VkImageView>                                                               m_additionalResolvedImageView;
+       Move<VkFramebuffer>                                                             m_additionalFrameBuffer;
+       Move<VkBuffer>                                                                  m_additionalResultBuffer;
+       de::MovePtr<Allocation>                                                 m_additionalResultBufferMemory;
 };
 
 BaseLineTestInstance::BaseLineTestInstance (Context& context,
@@ -1013,8 +1039,9 @@ BaseLineTestInstance::BaseLineTestInstance (Context& context,
                                                                                        PrimitiveWideness wideness,
                                                                                        VkSampleCountFlagBits sampleCount,
                                                                                        LineStipple stipple,
-                                                                                       VkLineRasterizationModeEXT      lineRasterizationMode)
-       : BaseRenderingTestInstance                     (context, sampleCount)
+                                                                                       VkLineRasterizationModeEXT      lineRasterizationMode,
+                                                                                       const deUint32 additionalRenderSize)
+       : BaseRenderingTestInstance                     (context, sampleCount, RESOLUTION_POT, VK_FORMAT_R8G8B8A8_UNORM, additionalRenderSize)
        , m_iteration                                           (0)
        , m_iterationCount                                      (3)
        , m_primitiveTopology                           (primitiveTopology)
@@ -1068,6 +1095,175 @@ BaseLineTestInstance::BaseLineTestInstance (Context& context,
        }
        else
                DE_ASSERT(false);
+
+       // Create image, image view and frame buffer for testing at an additional resolution if required.
+       if (m_additionalRenderSize != 0)
+       {
+               const DeviceInterface&                                          vkd                                             = m_context.getDeviceInterface();
+               const VkDevice                                                          vkDevice                                = m_context.getDevice();
+               const deUint32                                                          queueFamilyIndex                = m_context.getUniversalQueueFamilyIndex();
+               Allocator&                                                                      allocator                               = m_context.getDefaultAllocator();
+               DescriptorPoolBuilder                                           descriptorPoolBuilder;
+               DescriptorSetLayoutBuilder                                      descriptorSetLayoutBuilder;
+               {
+                       const VkImageUsageFlags imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT;
+                       const VkImageCreateInfo                                 imageCreateInfo                 =
+                       {
+                               VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,            // VkStructureType                      sType;
+                               DE_NULL,                                                                        // const void*                          pNext;
+                               0u,                                                                                     // VkImageCreateFlags           flags;
+                               VK_IMAGE_TYPE_2D,                                                       // VkImageType                          imageType;
+                               m_imageFormat,                                                          // VkFormat                                     format;
+                               { m_additionalRenderSize, m_additionalRenderSize, 1u },                 // VkExtent3D                           extent;
+                               1u,                                                                                     // deUint32                                     mipLevels;
+                               1u,                                                                                     // deUint32                                     arrayLayers;
+                               m_sampleCount,                                                          // VkSampleCountFlagBits        samples;
+                               VK_IMAGE_TILING_OPTIMAL,                                        // VkImageTiling                        tiling;
+                               imageUsage,                                                                     // VkImageUsageFlags            usage;
+                               VK_SHARING_MODE_EXCLUSIVE,                                      // VkSharingMode                        sharingMode;
+                               1u,                                                                                     // deUint32                                     queueFamilyIndexCount;
+                               &queueFamilyIndex,                                                      // const deUint32*                      pQueueFamilyIndices;
+                               VK_IMAGE_LAYOUT_UNDEFINED                                       // VkImageLayout                        initialLayout;
+                       };
+
+                       m_additionalImage = vk::createImage(vkd, vkDevice, &imageCreateInfo, DE_NULL);
+
+                       m_additionalImageMemory = allocator.allocate(getImageMemoryRequirements(vkd, vkDevice, *m_additionalImage), MemoryRequirement::Any);
+                       VK_CHECK(vkd.bindImageMemory(vkDevice, *m_additionalImage, m_additionalImageMemory->getMemory(), m_additionalImageMemory->getOffset()));
+               }
+
+               // Image View
+               {
+                       const VkImageViewCreateInfo                             imageViewCreateInfo             =
+                       {
+                               VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,       // VkStructureType                              sType;
+                               DE_NULL,                                                                        // const void*                                  pNext;
+                               0u,                                                                                     // VkImageViewCreateFlags               flags;
+                               *m_additionalImage,                                                     // VkImage                                              image;
+                               VK_IMAGE_VIEW_TYPE_2D,                                          // VkImageViewType                              viewType;
+                               m_imageFormat,                                                          // VkFormat                                             format;
+                               makeComponentMappingRGBA(),                                     // VkComponentMapping                   components;
+                               {
+                                       VK_IMAGE_ASPECT_COLOR_BIT,                                      // VkImageAspectFlags                   aspectMask;
+                                       0u,                                                                                     // deUint32                                             baseMipLevel;
+                                       1u,                                                                                     // deUint32                                             mipLevels;
+                                       0u,                                                                                     // deUint32                                             baseArrayLayer;
+                                       1u,                                                                                     // deUint32                                             arraySize;
+                               },                                                                                      // VkImageSubresourceRange              subresourceRange;
+                       };
+
+                       m_additionalImageView = vk::createImageView(vkd, vkDevice, &imageViewCreateInfo, DE_NULL);
+               }
+
+               if (m_multisampling)
+               {
+                       {
+                               const VkImageUsageFlags imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT;
+                               const VkImageCreateInfo                                 imageCreateInfo                 =
+                               {
+                                       VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO,            // VkStructureType                      sType;
+                                       DE_NULL,                                                                        // const void*                          pNext;
+                                       0u,                                                                                     // VkImageCreateFlags           flags;
+                                       VK_IMAGE_TYPE_2D,                                                       // VkImageType                          imageType;
+                                       m_imageFormat,                                                          // VkFormat                                     format;
+                                       { m_additionalRenderSize,       m_additionalRenderSize, 1u },                   // VkExtent3D                           extent;
+                                       1u,                                                                                     // deUint32                                     mipLevels;
+                                       1u,                                                                                     // deUint32                                     arrayLayers;
+                                       VK_SAMPLE_COUNT_1_BIT,                                          // VkSampleCountFlagBits        samples;
+                                       VK_IMAGE_TILING_OPTIMAL,                                        // VkImageTiling                        tiling;
+                                       imageUsage,                                                                     // VkImageUsageFlags            usage;
+                                       VK_SHARING_MODE_EXCLUSIVE,                                      // VkSharingMode                        sharingMode;
+                                       1u,                                                                                     // deUint32                                     queueFamilyIndexCount;
+                                       &queueFamilyIndex,                                                      // const deUint32*                      pQueueFamilyIndices;
+                                       VK_IMAGE_LAYOUT_UNDEFINED                                       // VkImageLayout                        initialLayout;
+                               };
+
+                               m_additionalResolvedImage                       = vk::createImage(vkd, vkDevice, &imageCreateInfo, DE_NULL);
+                               m_additionalResolvedImageMemory = allocator.allocate(getImageMemoryRequirements(vkd, vkDevice, *m_additionalResolvedImage), MemoryRequirement::Any);
+                               VK_CHECK(vkd.bindImageMemory(vkDevice, *m_additionalResolvedImage, m_additionalResolvedImageMemory->getMemory(), m_additionalResolvedImageMemory->getOffset()));
+                       }
+
+                       // Image view
+                       {
+                               const VkImageViewCreateInfo                             imageViewCreateInfo             =
+                               {
+                                       VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO,       // VkStructureType                              sType;
+                                       DE_NULL,                                                                        // const void*                                  pNext;
+                                       0u,                                                                                     // VkImageViewCreateFlags               flags;
+                                       *m_additionalResolvedImage,                                     // VkImage                                              image;
+                                       VK_IMAGE_VIEW_TYPE_2D,                                          // VkImageViewType                              viewType;
+                                       m_imageFormat,                                                          // VkFormat                                             format;
+                                       makeComponentMappingRGBA(),                                     // VkComponentMapping                   components;
+                                       {
+                                               VK_IMAGE_ASPECT_COLOR_BIT,                                      // VkImageAspectFlags                   aspectMask;
+                                               0u,                                                                                     // deUint32                                             baseMipLevel;
+                                               1u,                                                                                     // deUint32                                             mipLevels;
+                                               0u,                                                                                     // deUint32                                             baseArrayLayer;
+                                               1u,                                                                                     // deUint32                                             arraySize;
+                                       },                                                                                      // VkImageSubresourceRange              subresourceRange;
+                               };
+                               m_additionalResolvedImageView = vk::createImageView(vkd, vkDevice, &imageViewCreateInfo, DE_NULL);
+                       }
+               }
+
+               {
+                       const VkImageView                                               attachments[]                   =
+                       {
+                               *m_additionalImageView,
+                               *m_additionalResolvedImageView
+                       };
+
+                       const VkFramebufferCreateInfo                   framebufferCreateInfo   =
+                       {
+                               VK_STRUCTURE_TYPE_FRAMEBUFFER_CREATE_INFO,      // VkStructureType                      sType;
+                               DE_NULL,                                                                        // const void*                          pNext;
+                               0u,                                                                                     // VkFramebufferCreateFlags     flags;
+                               *m_renderPass,                                                          // VkRenderPass                         renderPass;
+                               m_multisampling ? 2u : 1u,                                      // deUint32                                     attachmentCount;
+                               attachments,                                                            // const VkImageView*           pAttachments;
+                               m_additionalRenderSize,                                         // deUint32                                     width;
+                               m_additionalRenderSize,                                         // deUint32                                     height;
+                               1u,                                                                                     // deUint32                                     layers;
+                       };
+                       m_additionalFrameBuffer = createFramebuffer(vkd, vkDevice, &framebufferCreateInfo, DE_NULL);
+               }
+
+               // Framebuffer
+               {
+                       const VkBufferCreateInfo                                bufferCreateInfo                =
+                       {
+                               VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,           // VkStructureType              sType;
+                               DE_NULL,                                                                        // const void*                  pNext;
+                               0u,                                                                                     // VkBufferCreateFlags  flags;
+                               m_additionalResultBufferSize,                                                   // VkDeviceSize                 size;
+                               VK_BUFFER_USAGE_TRANSFER_DST_BIT,                       // VkBufferUsageFlags   usage;
+                               VK_SHARING_MODE_EXCLUSIVE,                                      // VkSharingMode                sharingMode;
+                               1u,                                                                                     // deUint32                             queueFamilyIndexCount;
+                               &queueFamilyIndex                                                       // const deUint32*              pQueueFamilyIndices;
+                       };
+
+                       m_additionalResultBuffer                        = createBuffer(vkd, vkDevice, &bufferCreateInfo);
+                       m_additionalResultBufferMemory  = allocator.allocate(getBufferMemoryRequirements(vkd, vkDevice, *m_additionalResultBuffer), MemoryRequirement::HostVisible);
+
+                       VK_CHECK(vkd.bindBufferMemory(vkDevice, *m_additionalResultBuffer, m_additionalResultBufferMemory->getMemory(), m_additionalResultBufferMemory->getOffset()));
+               }
+       }
+}
+
+bool BaseLineTestInstance::resultHasAlpha(tcu::Surface& resultImage)
+{
+       bool hasAlpha = false;
+       for (int y = 0; y < resultImage.getHeight() && !hasAlpha; ++y)
+       for (int x = 0; x < resultImage.getWidth(); ++x)
+       {
+               const tcu::RGBA         color                           = resultImage.getPixel(x, y);
+               if (color.getAlpha() > 0 && color.getAlpha() < 0xFF)
+               {
+                       hasAlpha = true;
+                       break;
+               }
+       }
+       return hasAlpha;
 }
 
 tcu::TestStatus BaseLineTestInstance::iterate (void)
@@ -1076,6 +1272,7 @@ tcu::TestStatus BaseLineTestInstance::iterate (void)
        const tcu::ScopedLogSection                             section                                 (m_context.getTestContext().getLog(), iterationDescription, iterationDescription);
        const float                                                             lineWidth                               = getLineWidth();
        tcu::Surface                                                    resultImage                             (m_renderSize, m_renderSize);
+       tcu::Surface                                                    additionalResultImage   (m_additionalRenderSize, m_additionalRenderSize);
        std::vector<tcu::Vec4>                                  drawBuffer;
        std::vector<LineSceneSpec::SceneLine>   lines;
 
@@ -1089,74 +1286,86 @@ tcu::TestStatus BaseLineTestInstance::iterate (void)
                drawPrimitives(resultImage, drawBuffer, m_primitiveTopology);
 
                // compare
-               {
-                       RasterizationArguments  args;
-                       LineSceneSpec                   scene;
+               RasterizationArguments  args;
+               LineSceneSpec                   scene;
 
+               tcu::IVec4                              colorBits = tcu::getTextureFormatBitDepth(getTextureFormat());
 
-                       tcu::IVec4                              colorBits = tcu::getTextureFormatBitDepth(getTextureFormat());
+               args.numSamples         = m_multisampling ? 1 : 0;
+               args.subpixelBits       = m_subpixelBits;
+               args.redBits            = colorBits[0];
+               args.greenBits          = colorBits[1];
+               args.blueBits           = colorBits[2];
 
-                       args.numSamples         = m_multisampling ? 1 : 0;
-                       args.subpixelBits       = m_subpixelBits;
-                       args.redBits            = colorBits[0];
-                       args.greenBits          = colorBits[1];
-                       args.blueBits           = colorBits[2];
+               scene.lines.swap(lines);
+               scene.lineWidth = lineWidth;
+               scene.stippleEnable = getLineStippleEnable();
+               scene.stippleFactor = getLineStippleEnable() ? lineStippleFactor : 1;
+               scene.stipplePattern = getLineStippleEnable() ? lineStipplePattern : 0xFFFF;
+               scene.isStrip = m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
+               scene.isSmooth = m_lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
+
+               // Choose verification mode. Smooth lines assume mostly over-rasterization (bloated lines with a falloff).
+               // Stippled lines lose some precision across segments in a strip, so need a weaker threshold than normal
+               // lines. For simple cases, check for an exact match (STRICT).
+               if (scene.isSmooth)
+                       scene.verificationMode = tcu::VERIFICATIONMODE_SMOOTH;
+               else if (scene.stippleEnable)
+                       scene.verificationMode = tcu::VERIFICATIONMODE_WEAKER;
+               else
+                       scene.verificationMode = tcu::VERIFICATIONMODE_STRICT;
 
-                       scene.lines.swap(lines);
-                       scene.lineWidth = lineWidth;
-                       scene.stippleEnable = getLineStippleEnable();
-                       scene.stippleFactor = getLineStippleEnable() ? lineStippleFactor : 1;
-                       scene.stipplePattern = getLineStippleEnable() ? lineStipplePattern : 0xFFFF;
-                       scene.isStrip = m_primitiveTopology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP;
-                       scene.isSmooth = m_lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_RECTANGULAR_SMOOTH_EXT;
-
-                       // Choose verification mode. Smooth lines assume mostly over-rasterization (bloated lines with a falloff).
-                       // Stippled lines lose some precision across segments in a strip, so need a weaker threshold than normal
-                       // lines. For simple cases, check for an exact match (STRICT).
+               if (m_lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT)
+               {
+                       // bresenham is "no AA" in GL, so set numSamples to zero.
+                       args.numSamples = 0;
+                       if (!verifyLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog()))
+                               m_allIterationsPassed = false;
+               }
+               else
+               {
                        if (scene.isSmooth)
-                               scene.verificationMode = tcu::VERIFICATIONMODE_SMOOTH;
-                       else if (scene.stippleEnable)
-                               scene.verificationMode = tcu::VERIFICATIONMODE_WEAKER;
-                       else
-                               scene.verificationMode = tcu::VERIFICATIONMODE_STRICT;
+                       {
+                               // Smooth lines get the fractional coverage multiplied into the alpha component,
+                               // so do a sanity check to validate that there is at least one pixel in the image
+                               // with a fractional opacity.
+                               bool hasAlpha = resultHasAlpha(resultImage);
+                               if (!hasAlpha)
+                               {
+                                       m_context.getTestContext().getLog() << tcu::TestLog::Message << "Missing alpha transparency (failed)." << tcu::TestLog::EndMessage;
+                                       m_allIterationsPassed = false;
+                               }
+                       }
 
-                       if (m_lineRasterizationMode == VK_LINE_RASTERIZATION_MODE_BRESENHAM_EXT)
+                       if (!verifyRelaxedLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog(), (0 == m_multisampling)))
                        {
-                               // bresenham is "no AA" in GL, so set numSamples to zero.
-                               args.numSamples = 0;
-                               if (!verifyLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog()))
+                               // Retry with weaker verification. If it passes, consider it a quality warning.
+                               scene.verificationMode = tcu::VERIFICATIONMODE_WEAKER;
+                               if (!verifyRelaxedLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog()))
                                        m_allIterationsPassed = false;
+                               else
+                                       m_qualityWarning = true;
                        }
-                       else
+
+                       if (m_additionalRenderSize != 0)
                        {
+                               const std::vector<tcu::Vec4> colorData(drawBuffer.size(), tcu::Vec4(1.0f, 1.0f, 1.0f, 1.0f));
+
                                if (scene.isSmooth)
-                               {
-                                       // Smooth lines get the fractional coverage multiplied into the alpha component,
-                                       // so do a sanity check to validate that there is at least one pixel in the image
-                                       // with a fractional opacity.
-                                       bool hasAlpha = false;
-                                       for (int y = 0; y < resultImage.getHeight() && !hasAlpha; ++y)
-                                       for (int x = 0; x < resultImage.getWidth(); ++x)
-                                       {
-                                               const tcu::RGBA         color                           = resultImage.getPixel(x, y);
-                                               if (color.getAlpha() > 0 && color.getAlpha() < 0xFF)
-                                               {
-                                                       hasAlpha = true;
-                                                       break;
-                                               }
-                                       }
-                                       if (!hasAlpha)
-                                       {
-                                               m_context.getTestContext().getLog() << tcu::TestLog::Message << "Missing alpha transparency (failed)." << tcu::TestLog::EndMessage;
-                                               m_allIterationsPassed = false;
-                                       }
-                               }
+                                       scene.verificationMode = tcu::VERIFICATIONMODE_SMOOTH;
+                               else if (scene.stippleEnable)
+                                       scene.verificationMode = tcu::VERIFICATIONMODE_WEAKER;
+                               else
+                                       scene.verificationMode = tcu::VERIFICATIONMODE_STRICT;
 
-                               if (!verifyRelaxedLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog()))
+                               drawPrimitives(additionalResultImage, drawBuffer, colorData, m_primitiveTopology, *m_additionalImage, *m_additionalResolvedImage, *m_additionalFrameBuffer, m_additionalRenderSize, *m_additionalResultBuffer, *m_additionalResultBufferMemory);
+
+                               // Compare
+                               if (!verifyRelaxedLineGroupRasterization(additionalResultImage, scene, args, m_context.getTestContext().getLog(), (0 == m_multisampling)))
                                {
                                        // Retry with weaker verification. If it passes, consider it a quality warning.
                                        scene.verificationMode = tcu::VERIFICATIONMODE_WEAKER;
-                                       if (!verifyRelaxedLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog()))
+                                       if (!verifyRelaxedLineGroupRasterization(resultImage, scene, args, m_context.getTestContext().getLog(), (0 == m_multisampling)))
                                                m_allIterationsPassed = false;
                                        else
                                                m_qualityWarning = true;
@@ -1211,7 +1420,7 @@ VkPipelineRasterizationLineStateCreateInfoEXT BaseLineTestInstance::getLineRaste
 class PointTestInstance : public BaseRenderingTestInstance
 {
 public:
-                                                       PointTestInstance               (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, /*ignored*/LineStipple stipple, /*ignored*/VkLineRasterizationModeEXT lineRasterizationMode);
+                                                       PointTestInstance               (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, /*ignored*/LineStipple stipple, /*ignored*/VkLineRasterizationModeEXT lineRasterizationMode,  deUint32 renderSize);
        virtual tcu::TestStatus iterate                                 (void);
        virtual float                   getPointSize                    (void) const;
 
@@ -1226,7 +1435,7 @@ private:
        std::vector<float>              m_pointSizes;
 };
 
-PointTestInstance::PointTestInstance (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, /*ignored*/LineStipple stipple, /*ignored*/VkLineRasterizationModeEXT lineRasterizationMode)
+PointTestInstance::PointTestInstance (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, /*ignored*/LineStipple stipple, /*ignored*/VkLineRasterizationModeEXT lineRasterizationMode, deUint32)
        : BaseRenderingTestInstance     (context, sampleCount)
        , m_iteration                           (0)
        , m_iterationCount                      (3)
@@ -1911,17 +2120,18 @@ template <typename ConcreteTestInstance>
 class WidenessTestCase : public BaseRenderingTestCase
 {
 public:
-                                                               WidenessTestCase        (tcu::TestContext& context, const std::string& name, const std::string& description, PrimitiveWideness wideness, bool isLineTest, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode)
+                                                               WidenessTestCase        (tcu::TestContext& context, const std::string& name, const std::string& description, PrimitiveWideness wideness, bool isLineTest, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, deUint32 additionalRenderSize = 0)
                                                                        : BaseRenderingTestCase(context, name, description, sampleCount)
-                                                                       , m_wideness(wideness)
+                                                                       , m_wideness    (wideness)
                                                                        , m_isLineTest  (isLineTest)
                                                                        , m_stipple(stipple)
                                                                        , m_lineRasterizationMode(lineRasterizationMode)
+                                                                       , m_additionalRenderSize        (additionalRenderSize)
                                                                {}
 
        virtual TestInstance*           createInstance          (Context& context) const
                                                                {
-                                                                       return new ConcreteTestInstance(context, m_wideness, m_sampleCount, m_stipple, m_lineRasterizationMode);
+                                                                       return new ConcreteTestInstance(context, m_wideness, m_sampleCount, m_stipple, m_lineRasterizationMode, m_additionalRenderSize);
                                                                }
 
        virtual void                            checkSupport            (Context& context) const
@@ -1980,17 +2190,18 @@ public:
        virtual bool                    getLineStippleDynamic   (void) const { return m_stipple == LINESTIPPLE_DYNAMIC; };
 
 protected:
-       const PrimitiveWideness                         m_wideness;
-       const bool                                                      m_isLineTest;
+       const PrimitiveWideness         m_wideness;
+       const bool                                      m_isLineTest;
        const LineStipple                                       m_stipple;
        const VkLineRasterizationModeEXT        m_lineRasterizationMode;
+       const deUint32                          m_additionalRenderSize;
 };
 
 class LinesTestInstance : public BaseLineTestInstance
 {
 public:
-                                                               LinesTestInstance       (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode)
-                                                                       : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_LIST, wideness, sampleCount, stipple, lineRasterizationMode)
+                                                               LinesTestInstance       (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode,  deUint32 additionalRenderSize = 0)
+                                                                       : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_LIST, wideness, sampleCount, stipple, lineRasterizationMode, additionalRenderSize)
                                                                {}
 
        virtual void                            generateLines           (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines);
@@ -1998,7 +2209,7 @@ public:
 
 void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& outData, std::vector<LineSceneSpec::SceneLine>& outLines)
 {
-       outData.resize(6);
+       outData.resize(8);
 
        switch (iteration)
        {
@@ -2010,6 +2221,8 @@ void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& ou
                        outData[3] = tcu::Vec4(-0.3f,   0.2f, 0.0f, 1.0f);
                        outData[4] = tcu::Vec4(-1.5f,  -0.4f, 0.0f, 1.0f);
                        outData[5] = tcu::Vec4( 0.1f,   0.5f, 0.0f, 1.0f);
+                       outData[6] = tcu::Vec4( 0.75f, -0.4f, 0.0f, 1.0f);
+                       outData[7] = tcu::Vec4( 0.3f,   0.8f, 0.0f, 1.0f);
                        break;
 
                case 1:
@@ -2019,25 +2232,31 @@ void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& ou
                        outData[3] = tcu::Vec4(  0.11f,   0.2f, 0.0f, 1.0f);
                        outData[4] = tcu::Vec4(  0.88f,   0.9f, 0.0f, 1.0f);
                        outData[5] = tcu::Vec4(  0.18f,  -0.2f, 0.0f, 1.0f);
+                       outData[6] = tcu::Vec4(  0.0f,   1.0f, 0.0f, 1.0f);
+                       outData[7] = tcu::Vec4(  0.0f,  -1.0f, 0.0f, 1.0f);
                        break;
 
                case 2:
                        outData[0] = tcu::Vec4( -0.9f, -0.3f, 0.0f, 1.0f);
-                       outData[1] = tcu::Vec4(  0.9f, -0.9f, 0.0f, 1.0f);
+                       outData[1] = tcu::Vec4(  1.1f, -0.9f, 0.0f, 1.0f);
                        outData[2] = tcu::Vec4(  0.7f, -0.1f, 0.0f, 1.0f);
                        outData[3] = tcu::Vec4( 0.11f,  0.2f, 0.0f, 1.0f);
                        outData[4] = tcu::Vec4( 0.88f,  0.7f, 0.0f, 1.0f);
                        outData[5] = tcu::Vec4(  0.8f, -0.7f, 0.0f, 1.0f);
+                       outData[6] = tcu::Vec4(  1.0f,   0.0f, 0.0f, 1.0f);
+                       outData[7] = tcu::Vec4(  -1.0f,  0.0f, 0.0f, 1.0f);
                        break;
        }
 
-       outLines.resize(3);
+       outLines.resize(4);
        outLines[0].positions[0] = outData[0];
        outLines[0].positions[1] = outData[1];
        outLines[1].positions[0] = outData[2];
        outLines[1].positions[1] = outData[3];
        outLines[2].positions[0] = outData[4];
        outLines[2].positions[1] = outData[5];
+       outLines[3].positions[0] = outData[6];
+       outLines[3].positions[1] = outData[7];
 
        // log
        m_context.getTestContext().getLog() << tcu::TestLog::Message << "Rendering " << outLines.size() << " lines(s): (width = " << getLineWidth() << ")" << tcu::TestLog::EndMessage;
@@ -2055,7 +2274,7 @@ void LinesTestInstance::generateLines (int iteration, std::vector<tcu::Vec4>& ou
 class LineStripTestInstance : public BaseLineTestInstance
 {
 public:
-                                       LineStripTestInstance   (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode)
+                                       LineStripTestInstance   (Context& context, PrimitiveWideness wideness, VkSampleCountFlagBits sampleCount, LineStipple stipple, VkLineRasterizationModeEXT lineRasterizationMode, deUint32)
                                                : BaseLineTestInstance(context, VK_PRIMITIVE_TOPOLOGY_LINE_STRIP, wideness, sampleCount, stipple, lineRasterizationMode)
                                        {}
 
@@ -2250,9 +2469,9 @@ tcu::TestStatus FillRuleTestInstance::iterate (void)
 int FillRuleTestInstance::getRenderSize (FillRuleCaseType type) const
 {
        if (type == FILLRULECASE_CLIPPED_FULL || type == FILLRULECASE_CLIPPED_PARTIAL)
-               return DEFAULT_RENDER_SIZE / 4;
+               return RESOLUTION_POT / 4;
        else
-               return DEFAULT_RENDER_SIZE;
+               return RESOLUTION_POT;
 }
 
 int FillRuleTestInstance::getNumIterations (FillRuleCaseType type) const
@@ -2416,7 +2635,7 @@ class CullingTestInstance : public BaseRenderingTestInstance
 {
 public:
                                                                                                        CullingTestInstance                             (Context& context, VkCullModeFlags cullMode, VkPrimitiveTopology primitiveTopology, VkFrontFace frontFace, VkPolygonMode polygonMode)
-                                                                                                               : BaseRenderingTestInstance             (context, VK_SAMPLE_COUNT_1_BIT, DEFAULT_RENDER_SIZE)
+                                                                                                               : BaseRenderingTestInstance             (context, VK_SAMPLE_COUNT_1_BIT, RESOLUTION_POT)
                                                                                                                , m_cullMode                                    (cullMode)
                                                                                                                , m_primitiveTopology                   (primitiveTopology)
                                                                                                                , m_frontFace                                   (frontFace)
@@ -2715,7 +2934,7 @@ class DiscardTestInstance : public BaseRenderingTestInstance
 {
 public:
                                                                                                                        DiscardTestInstance                                     (Context& context, VkPrimitiveTopology primitiveTopology, deBool queryFragmentShaderInvocations)
-                                                                                                                               : BaseRenderingTestInstance                     (context, VK_SAMPLE_COUNT_1_BIT, DEFAULT_RENDER_SIZE)
+                                                                                                                               : BaseRenderingTestInstance                     (context, VK_SAMPLE_COUNT_1_BIT, RESOLUTION_POT)
                                                                                                                                , m_primitiveTopology                           (primitiveTopology)
                                                                                                                                , m_queryFragmentShaderInvocations      (queryFragmentShaderInvocations)
                                                                                                                        {}
@@ -3193,7 +3412,7 @@ class TriangleInterpolationTestInstance : public BaseRenderingTestInstance
 public:
 
                                                                TriangleInterpolationTestInstance       (Context& context, VkPrimitiveTopology primitiveTopology, int flags, VkSampleCountFlagBits sampleCount)
-                                                                       : BaseRenderingTestInstance     (context, sampleCount, DEFAULT_RENDER_SIZE)
+                                                                       : BaseRenderingTestInstance     (context, sampleCount, RESOLUTION_POT)
                                                                        , m_primitiveTopology           (primitiveTopology)
                                                                        , m_projective                          ((flags & INTERPOLATIONFLAGS_PROJECTED) != 0)
                                                                        , m_iterationCount                      (3)
@@ -3706,7 +3925,7 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
 
                        LineStipple stipple = (LineStipple)i;
 
-                       g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines",                                              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST, verify rasterization result",                                            PRIMITIVEWIDENESS_NARROW,       true, VK_SAMPLE_COUNT_1_BIT, stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
+                       g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines",                                              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST, verify rasterization result",                                            PRIMITIVEWIDENESS_NARROW,       true, VK_SAMPLE_COUNT_1_BIT, stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT, 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,       true, VK_SAMPLE_COUNT_1_BIT, 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,         true, VK_SAMPLE_COUNT_1_BIT, stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
                        g->addChild(new WidenessTestCase<LineStripTestInstance> (testCtx, "line_strip_wide",                    "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_STRIP with wide lines, verify rasterization result",           PRIMITIVEWIDENESS_WIDE,         true, VK_SAMPLE_COUNT_1_BIT, stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
@@ -3975,7 +4194,7 @@ void createRasterizationTests (tcu::TestCaseGroup* rasterizationTests)
 
                                LineStipple stipple = (LineStipple)i;
 
-                               g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines",                                              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST, verify rasterization result",                                            PRIMITIVEWIDENESS_NARROW,       true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
+                               g->addChild(new WidenessTestCase<LinesTestInstance>             (testCtx, "lines",                                              "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_LIST, verify rasterization result",                                            PRIMITIVEWIDENESS_NARROW,       true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT, 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,       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,         true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
                                g->addChild(new WidenessTestCase<LineStripTestInstance> (testCtx, "line_strip_wide",                    "Render primitives as VK_PRIMITIVE_TOPOLOGY_LINE_STRIP with wide lines, verify rasterization result",           PRIMITIVEWIDENESS_WIDE,         true, samples[samplesNdx], stipple, VK_LINE_RASTERIZATION_MODE_DEFAULT_EXT));
index bac16e3..85a80c9 100644 (file)
@@ -907,7 +907,7 @@ enum ClipMode
        CLIPMODE_LAST
 };
 
-bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, ClipMode clipMode, VerifyTriangleGroupRasterizationLogStash* logStash = DE_NULL)
+bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, ClipMode clipMode, VerifyTriangleGroupRasterizationLogStash* logStash = DE_NULL, const bool vulkanLinesTest = false)
 {
        // Multisampled line == 2 triangles
 
@@ -1060,7 +1060,7 @@ bool verifyMultisampleLineGroupRasterization (const tcu::Surface& surface, const
                }
        }
 
-       return verifyTriangleGroupRasterization(surface, triangleScene, args, log, scene.verificationMode, logStash);
+       return verifyTriangleGroupRasterization(surface, triangleScene, args, log, VERIFICATIONMODE_STRICT, logStash, vulkanLinesTest);
 }
 
 bool verifyMultisampleLineGroupInterpolation (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log)
@@ -1310,6 +1310,7 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
 
                if (missingFragments)
                {
+
                        allOK = false;
                }
                else
@@ -1555,18 +1556,15 @@ bool verifySinglesampleLineGroupRasterization (const tcu::Surface& surface, cons
 
        {
                tcu::Surface reference(surface.getWidth(), surface.getHeight());
-
-               // show a helpful reference image
                tcu::clear(reference.getAccess(), tcu::IVec4(0, 0, 0, 255));
                for (int y = 0; y < surface.getHeight(); ++y)
                for (int x = 0; x < surface.getWidth(); ++x)
                        if (referenceLineMap.getAccess().getPixelInt(x, y).x())
                                reference.setPixel(x, y, tcu::RGBA::white());
-
                log << tcu::TestLog::Message << "Invalid fragment count in result image." << tcu::TestLog::EndMessage;
                log << tcu::TestLog::ImageSet("Verification result", "Result of rendering")
                        << tcu::TestLog::Image("Reference", "Reference",        reference)
-                       << tcu::TestLog::Image("Result", "Result",                      surface)
+                       << tcu::TestLog::Image("Result", "Result", surface)
                        << tcu::TestLog::EndImageSet;
        }
 
@@ -2374,7 +2372,7 @@ static void verifyTriangleGroupRasterizationLog (const tcu::Surface& surface, tc
        }
 }
 
-bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const TriangleSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, VerificationMode mode, VerifyTriangleGroupRasterizationLogStash* logStash)
+bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const TriangleSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, VerificationMode mode, VerifyTriangleGroupRasterizationLogStash* logStash, const bool vulkanLinesTest)
 {
        DE_ASSERT(mode < VERIFICATIONMODE_LAST);
 
@@ -2488,8 +2486,30 @@ bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const Triang
                                break;
 
                        case COVERAGE_PARTIAL:
+                               {
+                                       bool foundFragment = false;
+                                       if (vulkanLinesTest == true)
+                                       {
+                                               for (int dy = -1; dy < 2 && !foundFragment; ++dy)
+                                                       for (int dx = -1; dx < 2 && !foundFragment; ++dx)
+                                                       {
+                                                               if (x + dx >= 0 && x + dx != surface.getWidth() && y + dy >= 0 && y + dy != surface.getHeight()
+                                                                       && (CoverageType)coverageMap.getAccess().getPixelUint(x + dx, y + dy).x() != COVERAGE_NONE)
+                                                               {
+                                                                       const tcu::RGBA color2 = surface.getPixel(x + dx , y + dy);
+                                                                       if (compareColors(color2, triangleColor, args.redBits, args.greenBits, args.blueBits))
+                                                                               foundFragment = true;
+                                                               }
+                                                       }
+                                       }
                                // anything goes
+                                       if (foundFragment == false)
+                                       {
                                errorMask.setPixel(x, y, partialPixelColor);
+                                               if (vulkanLinesTest == true)
+                                                       ++missingPixels;
+                                       }
+                               }
                                break;
 
                        case COVERAGE_FULL:
@@ -2556,12 +2576,12 @@ bool verifyClippedTriangulatedLineGroupRasterization (const tcu::Surface& surfac
        return verifyMultisampleLineGroupRasterization(surface, scene, args, log, CLIPMODE_USE_CLIPPING_BOX, DE_NULL);
 }
 
-bool verifyRelaxedLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log)
+bool verifyRelaxedLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool vulkanLinesTest)
 {
        VerifyTriangleGroupRasterizationLogStash noClippingLogStash;
        VerifyTriangleGroupRasterizationLogStash useClippingLogStash;
 
-       if (verifyMultisampleLineGroupRasterization(surface, scene, args, log, CLIPMODE_USE_CLIPPING_BOX, &useClippingLogStash))
+       if (verifyMultisampleLineGroupRasterization(surface, scene, args, log, CLIPMODE_USE_CLIPPING_BOX, &useClippingLogStash, vulkanLinesTest))
        {
                log << tcu::TestLog::Message << "Relaxed rasterization succeeded with CLIPMODE_USE_CLIPPING_BOX, details follow." << tcu::TestLog::EndMessage;
 
@@ -2569,7 +2589,7 @@ bool verifyRelaxedLineGroupRasterization (const tcu::Surface& surface, const Lin
 
                return true;
        }
-       else if (verifyMultisampleLineGroupRasterization(surface, scene, args, log, CLIPMODE_NO_CLIPPING, &noClippingLogStash))
+       else if (verifyMultisampleLineGroupRasterization(surface, scene, args, log, CLIPMODE_NO_CLIPPING, &noClippingLogStash, vulkanLinesTest))
        {
                log << tcu::TestLog::Message << "Relaxed rasterization succeeded with CLIPMODE_NO_CLIPPING, details follow." << tcu::TestLog::EndMessage;
 
index 7d20bd9..ffff501 100644 (file)
@@ -144,7 +144,7 @@ CoverageType calculateTriangleCoverage (const tcu::Vec4& p0, const tcu::Vec4& p1
  *
  * Returns false if invalid rasterization is found.
  *//*--------------------------------------------------------------------*/
-bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const TriangleSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, VerificationMode mode = VERIFICATIONMODE_STRICT, VerifyTriangleGroupRasterizationLogStash* logStash = DE_NULL);
+bool verifyTriangleGroupRasterization (const tcu::Surface& surface, const TriangleSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, VerificationMode mode = VERIFICATIONMODE_STRICT, VerifyTriangleGroupRasterizationLogStash* logStash = DE_NULL, const bool vulkanLinesTest = false);
 
 /*--------------------------------------------------------------------*//*!
  * \brief Verify line rasterization result
@@ -178,7 +178,7 @@ bool verifyClippedTriangulatedLineGroupRasterization (const tcu::Surface& surfac
  *
  * Returns false if both rasterizations are invalid.
  *//*--------------------------------------------------------------------*/
-bool verifyRelaxedLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log);
+bool verifyRelaxedLineGroupRasterization (const tcu::Surface& surface, const LineSceneSpec& scene, const RasterizationArguments& args, tcu::TestLog& log, const bool vulkanLinesTest = false);
 
 /*--------------------------------------------------------------------*//*!
  * \brief Verify point rasterization result