Merge vk-gl-cts/vulkan-cts-1.2.1 into vk-gl-cts/vulkan-cts-1.2.2
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 4 Jun 2020 07:48:51 +0000 (09:48 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Thu, 4 Jun 2020 07:48:51 +0000 (09:48 +0200)
Change-Id: I82327658d7f7ffcca53bf82654eef47936b31256

1  2 
external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp

@@@ -449,14 -449,12 +449,14 @@@ tcu::TestStatus testPrimitivesInside (C
        {
                log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
  
 -              const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
 -              DrawState                       drawState               (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -              DrawCallData            drawCallData    (vertices);
 -              VulkanProgram           vulkanProgram   (shaders);
 -
 -              VulkanDrawContext       drawContext(context, drawState, drawCallData, vulkanProgram);
 +              const std::vector<Vec4>         vertices                        = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
 +              FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +              PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +              DrawCallData                            drawCallData            (topology, vertices);
 +              VulkanProgram                           vulkanProgram           (shaders);
 +
 +              VulkanDrawContext                       drawContext                     (context, framebufferState);
 +              drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
                drawContext.draw();
  
                const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
@@@ -505,14 -503,12 +505,14 @@@ tcu::TestStatus testPrimitivesOutside (
        {
                log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
  
 -              const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
 -              DrawState                               drawState               (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -              DrawCallData                    drawCallData    (vertices);
 -              VulkanProgram                   vulkanProgram   (shaders);
 +              const std::vector<Vec4>         vertices                        = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 0.0f);
 +              FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +              PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +              DrawCallData                            drawCallData            (topology, vertices);
 +              VulkanProgram                           vulkanProgram           (shaders);
  
 -              VulkanDrawContext               drawContext(context, drawState, drawCallData, vulkanProgram);
 +              VulkanDrawContext                       drawContext                     (context, framebufferState);
 +              drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
                drawContext.draw();
  
                // All pixels must be black -- nothing is drawn.
@@@ -564,21 -560,25 +564,25 @@@ tcu::TestStatus testPrimitivesDepthClam
                        caseMinPixels[1] = caseMinPixels[3] = 2;
                        break;
  
-               case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
-               case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                case VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY:
                case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY:
+                       requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(), FEATURE_GEOMETRY_SHADER);
+                       // Fallthrough
+               case VK_PRIMITIVE_TOPOLOGY_LINE_LIST:
+               case VK_PRIMITIVE_TOPOLOGY_LINE_STRIP:
                        caseMinPixels[0] = regionPixels;
                        caseMinPixels[1] = RENDER_SIZE - 2;
                        caseMinPixels[2] = regionPixels;
                        caseMinPixels[3] = 2 * (RENDER_SIZE - 2);
                        break;
  
+               case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
+               case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
+                       requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(), FEATURE_GEOMETRY_SHADER);
+                       // Fallthrough
                case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST:
                case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP:
                case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_FAN:
-               case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST_WITH_ADJACENCY:
-               case VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP_WITH_ADJACENCY:
                        caseMinPixels[0] = caseMinPixels[1] = caseMinPixels[2] = caseMinPixels[3] = regionPixels;
                        break;
  
        {
                log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
  
 -              const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 -
 -              DrawState                                       drawState               (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -              DrawCallData                            drawCallData    (vertices);
 -              VulkanProgram                           vulkanProgram   (shaders);
 -              drawState.depthClampEnable = cases[caseNdx].depthClampEnable;
 +              const std::vector<Vec4>         vertices                        = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 +              FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +              PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +              pipelineState.depthClampEnable                                  = cases[caseNdx].depthClampEnable;
 +              DrawCallData                            drawCallData            (topology, vertices);
 +              VulkanProgram                           vulkanProgram           (shaders);
  
 -              VulkanDrawContext                       drawContext(context, drawState, drawCallData, vulkanProgram);
 +              VulkanDrawContext                       drawContext                     (context, framebufferState);
 +              drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
                drawContext.draw();
  
                const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
@@@ -681,17 -680,16 +685,17 @@@ tcu::TestStatus testPrimitivesDepthCli
        {
                log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
  
 -              const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 -
 -              DrawState                                       drawState               (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -              DrawCallData                            drawCallData    (vertices);
 -              VulkanProgram                           vulkanProgram   (shaders);
 -              drawState.depthClampEnable = false;
 -              drawState.explicitDepthClipEnable = true;
 -              drawState.depthClipEnable = cases[caseNdx].depthClipEnable;
 -
 -              VulkanDrawContext                       drawContext(context, drawState, drawCallData, vulkanProgram);
 +              const std::vector<Vec4>         vertices                        = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 +              FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +              PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +              pipelineState.depthClampEnable                                  = false;
 +              pipelineState.explicitDepthClipEnable                   = true;
 +              pipelineState.depthClipEnable                                   = cases[caseNdx].depthClipEnable;
 +              DrawCallData                            drawCallData            (topology, vertices);
 +              VulkanProgram                           vulkanProgram           (shaders);
 +
 +              VulkanDrawContext                       drawContext(context, framebufferState);
 +              drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
                drawContext.draw();
  
                const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
                {
                        log << tcu::TestLog::Message << cases[caseNdx].desc << tcu::TestLog::EndMessage;
  
 -                      const std::vector<Vec4> vertices = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 -
 -                      DrawState                                       drawState               (topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -                      DrawCallData                            drawCallData    (vertices);
 -                      VulkanProgram                           vulkanProgram   (shaders);
 -                      drawState.depthClampEnable = true;
 -                      drawState.explicitDepthClipEnable = true;
 -                      drawState.depthClipEnable = cases[caseNdx].depthClipEnable;
 -
 -                      VulkanDrawContext                       drawContext(context, drawState, drawCallData, vulkanProgram);
 +                      const std::vector<Vec4>         vertices                        = genVertices(topology, Vec4(0.0f, 0.0f, cases[caseNdx].zPos, 0.0f), 1.0f);
 +                      FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +                      PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +                      pipelineState.depthClampEnable                                  = true;
 +                      pipelineState.explicitDepthClipEnable                   = true;
 +                      pipelineState.depthClipEnable                                   = cases[caseNdx].depthClipEnable;
 +                      DrawCallData                            drawCallData            (topology, vertices);
 +                      VulkanProgram                           vulkanProgram           (shaders);
 +
 +                      VulkanDrawContext                       drawContext(context, framebufferState);
 +                      drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
                        drawContext.draw();
  
                        const int numPixels = countPixels(drawContext.getColorPixels(), cases[caseNdx].regionOffset, regionSize, cases[caseNdx].color, Vec4());
@@@ -785,13 -782,11 +789,13 @@@ tcu::TestStatus testLargePoints (Contex
  
        log << tcu::TestLog::Message << "Drawing several large points just outside the clip volume. Expecting an empty image or all points rendered." << tcu::TestLog::EndMessage;
  
 -      DrawState                       drawState               (VK_PRIMITIVE_TOPOLOGY_POINT_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -      DrawCallData            drawCallData    (vertices);
 -      VulkanProgram           vulkanProgram   (shaders);
 +      FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +      PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +      DrawCallData                            drawCallData            (VK_PRIMITIVE_TOPOLOGY_POINT_LIST, vertices);
 +      VulkanProgram                           vulkanProgram           (shaders);
  
 -      VulkanDrawContext       drawContext(context, drawState, drawCallData, vulkanProgram);
 +      VulkanDrawContext                       drawContext(context, framebufferState);
 +      drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
        drawContext.draw();
  
        // Popful case: All pixels must be black -- nothing is drawn.
@@@ -917,13 -912,12 +921,13 @@@ tcu::TestStatus testWideLines (Context
                << tcu::TestLog::Message << "Line width is " << lineWidth << "." << tcu::TestLog::EndMessage
                << tcu::TestLog::Message << "strictLines is " << (strictLines ? "VK_TRUE." : "VK_FALSE.") << tcu::TestLog::EndMessage;
  
 -      DrawState                                       drawState               (VK_PRIMITIVE_TOPOLOGY_LINE_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -      DrawCallData                            drawCallData    (vertices);
 -      VulkanProgram                           vulkanProgram   (shaders);
 -      drawState.lineWidth                     = lineWidth;
 +      FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +      PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +      DrawCallData                            drawCallData            (VK_PRIMITIVE_TOPOLOGY_LINE_LIST, vertices);
 +      VulkanProgram                           vulkanProgram           (shaders);
  
 -      VulkanDrawContext                       drawContext(context, drawState, drawCallData, vulkanProgram);
 +      VulkanDrawContext                       drawContext(context, framebufferState);
 +      drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
        drawContext.draw();
  
        // Popful case: All pixels must be black -- nothing is drawn.
                        refVertices.push_back(wideLineVertices[3]);
                }
  
 -              WideLineVertexShader            vertexShader;
 -              WideLineFragmentShader          fragmentShader;
 +              std::shared_ptr<rr::VertexShader>       vertexShader    = std::make_shared<WideLineVertexShader>();
 +              std::shared_ptr<rr::FragmentShader>     fragmentShader  = std::make_shared<WideLineFragmentShader>();
  
                // Draw wide line was two triangles
 -              DrawState                                       refDrawState    (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -              DrawCallData                            refCallData             (refVertices);
 -              ReferenceDrawContext            refDrawContext  (refDrawState, refCallData, vertexShader, fragmentShader);
 +              DrawCallData                            refCallData                     (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, refVertices);
  
 +              ReferenceDrawContext            refDrawContext          (framebufferState);
 +              refDrawContext.registerDrawObject( pipelineState, vertexShader, fragmentShader, refCallData );
                refDrawContext.draw();
  
                if (tcu::intThresholdCompare(log, "Compare", "Result comparsion", refDrawContext.getColorPixels(), drawContext.getColorPixels(), tcu::UVec4(1), tcu::COMPARE_LOG_ON_ERROR))
@@@ -1321,15 -1315,14 +1325,15 @@@ tcu::TestStatus testClipDistance (Conte
                << tcu::TestLog::Message << "Using " << caseDef.numClipDistances << " ClipDistance(s) and " << caseDef.numCullDistances << " CullDistance(s)" << tcu::TestLog::EndMessage
                << tcu::TestLog::Message << "Expecting upper half of the clipped bars to be black." << tcu::TestLog::EndMessage;
  
 -      DrawState                       drawState               (caseDef.topology, RENDER_SIZE, RENDER_SIZE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -      DrawCallData            drawCallData    (vertices);
 -      VulkanProgram           vulkanProgram   (shaders);
 -
 +      FrameBufferState                        framebufferState        (RENDER_SIZE, RENDER_SIZE);
 +      PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
        if (caseDef.enableTessellation)
 -              drawState.numPatchControlPoints = NUM_PATCH_CONTROL_POINTS;
 +              pipelineState.numPatchControlPoints = NUM_PATCH_CONTROL_POINTS;
 +      DrawCallData                            drawCallData            (caseDef.topology, vertices);
 +      VulkanProgram                           vulkanProgram           (shaders);
  
 -      VulkanDrawContext       drawContext(context, drawState, drawCallData, vulkanProgram);
 +      VulkanDrawContext                       drawContext                     (context, framebufferState);
 +      drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
        drawContext.draw();
  
        // Count black pixels in the whole image.
@@@ -1451,14 -1444,12 +1455,14 @@@ tcu::TestStatus testComplementarity (Co
                << tcu::TestLog::Message << "Using " << numClipDistances << " clipping plane(s), one of them possibly having negative values." << tcu::TestLog::EndMessage
                << tcu::TestLog::Message << "Expecting a uniform gray area, no missing (black) nor overlapped (white) pixels." << tcu::TestLog::EndMessage;
  
 -      DrawState                                       drawState               (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, RENDER_SIZE_LARGE, RENDER_SIZE_LARGE, context.getDeviceProperties().limits.subPixelPrecisionBits);
 -      DrawCallData                            drawCallData    (vertices);
 -      VulkanProgram                           vulkanProgram   (shaders);
 -      drawState.blendEnable           = true;
 +      FrameBufferState                        framebufferState        (RENDER_SIZE_LARGE, RENDER_SIZE_LARGE);
 +      PipelineState                           pipelineState           (context.getDeviceProperties().limits.subPixelPrecisionBits);
 +      pipelineState.blendEnable       = true;
 +      DrawCallData                            drawCallData            (VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST, vertices);
 +      VulkanProgram                           vulkanProgram           (shaders);
  
 -      VulkanDrawContext                       drawContext(context, drawState, drawCallData, vulkanProgram);
 +      VulkanDrawContext                       drawContext                     (context, framebufferState);
 +      drawContext.registerDrawObject(pipelineState, vulkanProgram, drawCallData);
        drawContext.draw();
  
        const int numGrayPixels         = countPixels(drawContext.getColorPixels(), Vec4(0.5f, 0.5f, 0.5f, 1.0f), Vec4(0.02f, 0.02f, 0.02f, 0.0f));