Allow helper invocations inside primitive.
authorMika Isojärvi <misojarvi@google.com>
Wed, 3 Feb 2016 00:02:21 +0000 (16:02 -0800)
committerMika Isojärvi <misojarvi@google.com>
Wed, 3 Feb 2016 18:05:01 +0000 (10:05 -0800)
Test required that helper invocations would only happen on primitive
edges, which produced false negatives if wide lines are rendered as
two triangles. This change allows helper invocations anywhere inside
the primitive.

Bug: 22180525
Change-Id: Iee7b50e7a46e4b172c3a61298a7f737d00b29750

android/cts/master/com.drawelements.deqp.gles31.xml
android/cts/master/gles31-master.txt
android/cts/master/src/gles31-test-issues.txt
modules/gles31/functional/es31fShaderHelperInvocationTests.cpp

index 72145a2..75c65a5 100644 (file)
                                                <Test name="lines_4_samples_fwidth">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
+                                               <Test name="wide_lines_4_samples_dfdx">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_4_samples_dfdy">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_4_samples_fwidth">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
                                                <Test name="points_4_samples_dfdx">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                                <Test name="lines_8_samples_fwidth">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
+                                               <Test name="wide_lines_8_samples_dfdx">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_8_samples_dfdy">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_8_samples_fwidth">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
                                                <Test name="points_8_samples_dfdx">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                                <Test name="lines_max_samples_fwidth">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
+                                               <Test name="wide_lines_max_samples_dfdx">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_max_samples_dfdy">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                               <Test name="wide_lines_max_samples_fwidth">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
                                                <Test name="points_max_samples_dfdx">
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
index d7f3cc2..5e2887c 100644 (file)
@@ -4064,6 +4064,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_4_samples_fw
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_4_samples_fwidth
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_dfdx
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_dfdy
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_4_samples_fwidth
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_4_samples_fwidth
@@ -4076,6 +4079,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_8_samples_fw
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_8_samples_fwidth
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_dfdx
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_dfdy
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_8_samples_fwidth
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_8_samples_fwidth
@@ -4088,6 +4094,9 @@ dEQP-GLES31.functional.shaders.helper_invocation.derivate.triangles_max_samples_
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.lines_max_samples_fwidth
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_dfdx
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_dfdy
+dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_max_samples_fwidth
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_dfdx
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_dfdy
 dEQP-GLES31.functional.shaders.helper_invocation.derivate.points_max_samples_fwidth
index b9169b6..f6e1cef 100644 (file)
@@ -19,9 +19,6 @@ dEQP-GLES31.functional.shaders.multisample_interpolation.interpolate_at_centroid
 dEQP-GLES31.functional.shaders.builtin_functions.precision.atan2.mediump_*
 dEQP-GLES31.functional.shaders.builtin_functions.precision.atan2.highp_*
 
-# Bug 22180525
-dEQP-GLES31.functional.shaders.helper_invocation.derivate.wide_lines_*_samples_*
-
 # Bug 22302334
 dEQP-GLES31.functional.shaders.builtin_functions.precision.acosh.highp_*
 dEQP-GLES31.functional.shaders.builtin_functions.precision.atanh.highp_*
index 125496b..a173d51 100644 (file)
@@ -542,24 +542,16 @@ void HelperInvocationDerivateCase::deinit (void)
 
 static bool hasNeighborWithColor (const tcu::Surface& surface, int x, int y, tcu::RGBA color, tcu::RGBA threshold)
 {
-       static const IVec2 s_neighbors[] =
-       {
-               IVec2(-1, -1),
-               IVec2( 0, -1),
-               IVec2(+1, -1),
-               IVec2(-1,  0),
-               IVec2(+1,  0),
-               IVec2(-1, +1),
-               IVec2( 0, +1),
-               IVec2(+1, +1)
-       };
-
        const int       w       = surface.getWidth();
        const int       h       = surface.getHeight();
 
-       for (int sample = 0; sample < DE_LENGTH_OF_ARRAY(s_neighbors); sample++)
+       for (int dx = -1; dx < 2; dx++)
+       for (int dy = -1; dy < 2; dy++)
        {
-               const IVec2     pos     = IVec2(x, y) + s_neighbors[sample];
+               const IVec2     pos     = IVec2(x + dx, y + dy);
+
+               if (dx == 0 && dy == 0)
+                       continue;
 
                if (de::inBounds(pos.x(), 0, w) && de::inBounds(pos.y(), 0, h))
                {
@@ -598,8 +590,8 @@ static bool verifyHelperInvocationDerivate (TestLog& log, const tcu::Surface& re
                        if (nonZeroDeriv)
                                numNonZeroDeriv += 1;
 
-                       if ((!isBg && !isFg) ||                         // Neither of valid colors (ignoring blue channel that has derivate)
-                               (nonZeroDeriv && !neighborBg))  // Has non-zero derivate, but sample not at primitive edge
+                       if ((!isBg && !isFg) ||                                                 // Neither of valid colors (ignoring blue channel that has derivate)
+                               (nonZeroDeriv && !neighborBg && !isFg))         // Has non-zero derivate, but sample not at primitive edge or inside primitive
                                numInvalidPixels += 1;
 
                        if (isFg)