Merge vk-gl-cts/master into vk-gl-cts/vulkan-cts-next-dev
authorAlexander Galazin <alexander.galazin@arm.com>
Thu, 31 Aug 2017 18:12:11 +0000 (20:12 +0200)
committerAlexander Galazin <alexander.galazin@arm.com>
Fri, 1 Sep 2017 07:34:23 +0000 (09:34 +0200)
Change-Id: If018dc6d1a4134e6890419870b28dead7b7f895c

1  2 
AndroidGen.mk
android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/clipping/vktClippingTests.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmGraphicsShaderTestUtil.cpp
external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmInstructionTests.cpp
external/vulkancts/mustpass/1.0.3/vk-default.txt

diff --cc AndroidGen.mk
Simple merge
Simple merge
@@@ -569,32 -545,9 +569,27 @@@ tcu::TestStatus testLargePoints (Contex
  {
        requireFeatures(context.getInstanceInterface(), context.getPhysicalDevice(), FEATURE_LARGE_POINTS);
  
 -      std::vector<Shader> shaders;
 -      shaders.push_back(Shader(VK_SHADER_STAGE_VERTEX_BIT,    context.getBinaryCollection().get("vert")));
 -      shaders.push_back(Shader(VK_SHADER_STAGE_FRAGMENT_BIT,  context.getBinaryCollection().get("frag")));
 +      bool pointClippingOutside = true;
 +
 +      if (de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_maintenance2"))
 +      {
 +              VkPointClippingBehaviorKHR clippingBehavior = getClippingBehavior(context.getInstanceInterface(), context.getPhysicalDevice());
 +
 +              switch (clippingBehavior)
 +              {
 +                      case VK_POINT_CLIPPING_BEHAVIOR_ALL_CLIP_PLANES_KHR:            pointClippingOutside = true;                            break;
 +                      case VK_POINT_CLIPPING_BEHAVIOR_USER_CLIP_PLANES_ONLY_KHR:      pointClippingOutside = false;                           break;
 +                      case invalidClippingBehavior:                                                           TCU_FAIL("Clipping behavior read failure");     break;
 +                      default:
 +                      {
 +                              TCU_FAIL("Unexpected clipping behavior reported");
 +                      }
 +              }
 +      }
-       else
-       {
-               //TODO: Now we have 2 cases {some-points-drawn|nothing}, we should have {all-points-drawn|some-points-drawn|nothing}
-               return tcu::TestStatus::pass("OK");
-       }
 +
 +      std::vector<VulkanShader> shaders;
 +      shaders.push_back(VulkanShader(VK_SHADER_STAGE_VERTEX_BIT,              context.getBinaryCollection().get("vert")));
 +      shaders.push_back(VulkanShader(VK_SHADER_STAGE_FRAGMENT_BIT,    context.getBinaryCollection().get("frag")));
  
        std::vector<Vec4> vertices;
        {
        VulkanDrawContext       drawContext(context, drawState, drawCallData, vulkanProgram);
        drawContext.draw();
  
 -      const int numBlackPixels = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
+       // Popful case: All pixels must be black -- nothing is drawn.
 +      const int       numBlackPixels  = countPixels(drawContext.getColorPixels(), Vec4(0.0f, 0.0f, 0.0f, 1.0f), Vec4());
 +      bool            result                  = false;
  
 -      // Test passes if nothing or all points are rendered, allowing implementations to use either popful or pop-free point clipping rules.
 -      if (numBlackPixels == NUM_RENDER_PIXELS || allPointsRendered)
 -              return tcu::TestStatus::pass("OK");
+       // Pop-free case: All points must be rendered.
+       bool allPointsRendered = true;
+       for (std::vector<Vec4>::iterator i = vertices.begin(); i != vertices.end(); ++i)
+       {
+               if (countPixels(drawContext.getColorPixels(), Vec4(1.0f, i->z(), 0.0f, 1.0f), Vec4(0.01f)) == 0)
+                       allPointsRendered = false;
+       }
-               // All pixels must be black -- nothing is drawn.
-               result = (numBlackPixels == NUM_RENDER_PIXELS);
 +      if (pointClippingOutside)
 +      {
++              result = (numBlackPixels == NUM_RENDER_PIXELS || allPointsRendered);
 +      }
        else
 -              return tcu::TestStatus::fail("Rendered image(s) are incorrect");
 +      {
-               // Rendering pixels without clipping: some pixels should not be black -- something is drawn.
-               result = (numBlackPixels < NUM_RENDER_PIXELS);
++              // Rendering pixels without clipping: all points should be drawn.
++              result = (allPointsRendered == true);
 +      }
 +
 +      return (result ? tcu::TestStatus::pass("OK") : tcu::TestStatus::fail("Rendered image(s) are incorrect"));
  }
  
  //! Wide line clipping