Add precise to tessellation fill_cover_* tests
authorJarkko Pöyry <jpoyry@google.com>
Sat, 21 Feb 2015 01:49:19 +0000 (17:49 -0800)
committerJarkko Pöyry <jpoyry@google.com>
Sat, 21 Feb 2015 01:56:44 +0000 (17:56 -0800)
- Add precise to misc_draw.fill_cover_* to avoid gaps in tessellated edges.
- Remove misleading comments.
- Add comments to describe why precise is not required to some tess eval
  shaders.

Bug: 19462784
Change-Id: Ia5e49c1b0cc0edd0e3c5d902e7b1f19dd841a9ac

modules/gles31/functional/es31fTessellationGeometryInteractionTests.cpp
modules/gles31/functional/es31fTessellationTests.cpp
modules/gles31/stress/es31sTessellationGeometryInteractionTests.cpp

index 4e0e920..6009dfb 100644 (file)
@@ -362,6 +362,7 @@ std::string IdentityGeometryShaderCase::getTessellationEvaluationSource (bool ge
                        "in highp vec4 v_patch_color[];\n"
                        "out highp vec4 " << colorOutputName << ";\n"
                        "\n"
+                       "// \\note No need to use precise gl_Position since we do not require gapless geometry\n"
                        "void main (void)\n"
                        "{\n";
 
@@ -665,6 +666,7 @@ std::string IdentityTessellationShaderCase::getTessellationEvaluationSource (voi
                        "in highp vec4 v_control_color[];\n"
                        "out highp vec4 v_evaluated_color;\n"
                        "\n"
+                       "// \\note No need to use precise gl_Position since we do not require gapless geometry\n"
                        "void main (void)\n"
                        "{\n";
 
@@ -1449,6 +1451,7 @@ std::string FeedbackPrimitiveTypeCase::getTessellationEvaluationSource (void) co
                        "\n"
                        "out highp vec4 v_tessellationCoords;\n"
                        "\n"
+                       "// \\note No need to use precise gl_Position since we do not require gapless geometry\n"
                        "void main (void)\n"
                        "{\n"
                        "       if (gl_PatchVerticesIn != 9)\n"
@@ -2580,6 +2583,7 @@ std::string GridRenderCase::getTessellationEvaluationSource (int tessLevel)
                        "\n"
                        "out mediump ivec2 v_tessellationGridPosition;\n"
                        "\n"
+                       "// \\note No need to use precise gl_Position since position does not depend on order\n"
                        "void main (void)\n"
                        "{\n";
 
index e373bda..1feb115 100644 (file)
@@ -1634,9 +1634,6 @@ void CommonEdgeCase::init (void)
                                                                                                         "void main (void)\n"
                                                                                                         "{\n"
                                                                                                         + (m_primitiveType == TESSPRIMITIVETYPE_TRIANGLES ?
-                                                                                                               string(m_caseType == CASETYPE_PRECISE
-                                                                                                                       ? "\t// Note: when this is an edge vertex, at most two of the following terms are non-zero (so order doesn't matter)\n"
-                                                                                                                       : "") +
                                                                                                                "       highp vec2 pos = gl_TessCoord.x*in_te_position[0] + gl_TessCoord.y*in_te_position[1] + gl_TessCoord.z*in_te_position[2];\n"
                                                                                                                "\n"
                                                                                                                "       highp float f = sqrt(3.0 * min(gl_TessCoord.x, min(gl_TessCoord.y, gl_TessCoord.z))) * 0.5 + 0.5;\n"
@@ -1653,7 +1650,6 @@ void CommonEdgeCase::init (void)
                                                                                                                        "       highp vec2 b = (    gl_TessCoord.x)*(1.0-gl_TessCoord.y)*in_te_position[1];\n"
                                                                                                                        "       highp vec2 c = (1.0-gl_TessCoord.x)*(    gl_TessCoord.y)*in_te_position[2];\n"
                                                                                                                        "       highp vec2 d = (    gl_TessCoord.x)*(    gl_TessCoord.y)*in_te_position[3];\n"
-                                                                                                                       "       // Note: when this is an edge vertex, at most two of the following terms are non-zero (so order doesn't matter)\n"
                                                                                                                        "       highp vec2 pos = a+b+c+d;\n"
                                                                                                                 : DE_NULL) +
                                                                                                                "\n"
@@ -2443,6 +2439,12 @@ public:
        }
 
 protected:
+       void init (void)
+       {
+               checkExtensionSupport(m_context, "GL_EXT_gpu_shader5");
+               BasicVariousTessLevelsPosAttrCase::init();
+       }
+
        const glu::ProgramSources makeSources (TessPrimitiveType primitiveType, SpacingMode spacing, const char* vtxOutPosAttrName) const
        {
                return glu::ProgramSources()
@@ -2459,11 +2461,13 @@ protected:
 
                        << glu::TessellationEvaluationSource    ("#version 310 es\n"
                                                                                                         "#extension GL_EXT_tessellation_shader : require\n"
+                                                                                                        "#extension GL_EXT_gpu_shader5 : require\n"
                                                                                                         "\n"
                                                                                                         + getTessellationEvaluationInLayoutString(primitiveType, spacing) +
                                                                                                         "\n"
                                                                                                         "in highp vec2 in_te_position[];\n"
                                                                                                         "\n"
+                                                                                                        "precise gl_Position;\n"
                                                                                                         "void main (void)\n"
                                                                                                         "{\n"
                                                                                                         + (primitiveType == TESSPRIMITIVETYPE_TRIANGLES ?
index 6314c46..cdd0dce 100644 (file)
@@ -473,6 +473,7 @@ std::string GridRenderCase::getTessellationEvaluationSource (int tessLevel)
                        "\n"
                        "out mediump ivec2 v_tessellationGridPosition;\n"
                        "\n"
+                       "// \\note No need to use precise gl_Position since position does not depend on order\n"
                        "void main (void)\n"
                        "{\n"
                        "       // Fill the whole viewport\n"