Fix clip_volume test drawing points
authorPetros Bantolas <petros.bantolas@imgtec.com>
Tue, 20 Sep 2016 08:45:03 +0000 (09:45 +0100)
committerPyry Haulos <phaulos@google.com>
Fri, 23 Sep 2016 19:08:36 +0000 (15:08 -0400)
According to spec, "[...] if no value was written to PointSize, results
are undefined".

Modified tests:
- dEQP-VK.clipping.clip_volume.{inside,outside,depth_clamp}.point_list
- dEQP-VK.clipping.clip_volume.clipped.large_points

Change-Id: I06ed228a9e4563df15801ff402ed5eac946ac9a6

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

index c0f4666..11d245f 100644 (file)
@@ -731,11 +731,11 @@ enum LineOrientation
        LINE_ORIENTATION_DIAGONAL,
 };
 
        LINE_ORIENTATION_DIAGONAL,
 };
 
-void addProgramsWithPointSize (SourceCollections& programCollection, const float pointSize)
+void addSimplePrograms (SourceCollections& programCollection, const float pointSize = 0.0f)
 {
        // Vertex shader
        {
 {
        // Vertex shader
        {
-               const bool usePointSize = pointSize > 1.0f;
+               const bool usePointSize = pointSize > 0.0f;
 
                std::ostringstream src;
                src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
 
                std::ostringstream src;
                src << glu::getGLSLVersionDeclaration(glu::GLSL_VERSION_450) << "\n"
@@ -774,19 +774,19 @@ void addProgramsWithPointSize (SourceCollections& programCollection, const float
 
 void initPrograms (SourceCollections& programCollection, const VkPrimitiveTopology topology)
 {
 
 void initPrograms (SourceCollections& programCollection, const VkPrimitiveTopology topology)
 {
-       DE_UNREF(topology);
-       addProgramsWithPointSize(programCollection, 1.0f);
+       const float pointSize = (topology == VK_PRIMITIVE_TOPOLOGY_POINT_LIST ? 1.0f : 0.0f);
+       addSimplePrograms(programCollection, pointSize);
 }
 
 void initPrograms (SourceCollections& programCollection, const LineOrientation lineOrientation)
 {
        DE_UNREF(lineOrientation);
 }
 
 void initPrograms (SourceCollections& programCollection, const LineOrientation lineOrientation)
 {
        DE_UNREF(lineOrientation);
-       addProgramsWithPointSize(programCollection, 1.0f);
+       addSimplePrograms(programCollection);
 }
 
 void initProgramsPointSize (SourceCollections& programCollection)
 {
 }
 
 void initProgramsPointSize (SourceCollections& programCollection)
 {
-       addProgramsWithPointSize(programCollection, 0.75f * RENDER_SIZE);
+       addSimplePrograms(programCollection, 0.75f * RENDER_SIZE);
 }
 
 //! Primitives fully inside the clip volume.
 }
 
 //! Primitives fully inside the clip volume.