Added test case for for loop with trivial continue.
authorKenneth Russell <kbr@google.com>
Thu, 17 Dec 2015 02:19:23 +0000 (18:19 -0800)
committerKenneth Russell <kbr@google.com>
Fri, 18 Dec 2015 00:28:18 +0000 (16:28 -0800)
The GLES2 version of this test catches a GLSL compiler crash on certain
GPUs. The GLES3 version passes on the same hardware.

BUG: 25820266

Change-Id: I502bcb23c6bf144b46db86bb1a8a2f456021d15f

android/cts/master/com.drawelements.deqp.gles2.xml
android/cts/master/com.drawelements.deqp.gles3.xml
android/cts/master/gles2-master.txt
android/cts/master/gles3-master.txt
data/gles2/shaders/loops.test [new file with mode: 0644]
data/gles3/shaders/loops.test [new file with mode: 0644]
modules/gles2/functional/es2fShaderLoopTests.cpp
modules/gles3/functional/es3fShaderLoopTests.cpp

index 076804f..c405fce 100644 (file)
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                        </TestCase>
+                                       <TestCase name="custom">
+                                               <Test name="continue_in_fragment_for_loop">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                       </TestCase>
                                </TestSuite>
                                <TestSuite name="operator">
                                        <TestSuite name="unary_operator">
index 7238e96..715dc14 100644 (file)
                                                        <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
                                                </Test>
                                        </TestCase>
+                                       <TestCase name="custom">
+                                               <Test name="continue_in_fragment_for_loop">
+                                                       <TestInstance glconfig="rgba8888d24s8ms0" rotation="unspecified" surfacetype="window"/>
+                                               </Test>
+                                       </TestCase>
                                </TestSuite>
                                <TestSuite name="operator">
                                        <TestSuite name="unary_operator">
index c85cca6..b05404a 100644 (file)
@@ -2893,6 +2893,7 @@ dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.conditional_body
 dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.conditional_body_fragment
 dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.function_call_return_fragment
 dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.function_call_inout_fragment
+dEQP-GLES2.functional.shaders.loops.custom.continue_in_fragment_for_loop
 dEQP-GLES2.functional.shaders.operator.unary_operator.plus.lowp_float_vertex
 dEQP-GLES2.functional.shaders.operator.unary_operator.plus.lowp_float_fragment
 dEQP-GLES2.functional.shaders.operator.unary_operator.plus.mediump_float_vertex
index 11a2697..63f2c76 100644 (file)
@@ -5774,6 +5774,7 @@ dEQP-GLES3.functional.shaders.loops.do_while_dynamic_iterations.nested_tricky_da
 dEQP-GLES3.functional.shaders.loops.do_while_dynamic_iterations.nested_tricky_dataflow_1_fragment
 dEQP-GLES3.functional.shaders.loops.do_while_dynamic_iterations.nested_tricky_dataflow_2_vertex
 dEQP-GLES3.functional.shaders.loops.do_while_dynamic_iterations.nested_tricky_dataflow_2_fragment
+dEQP-GLES3.functional.shaders.loops.custom.continue_in_fragment_for_loop
 dEQP-GLES3.functional.shaders.operator.unary_operator.plus.lowp_float_vertex
 dEQP-GLES3.functional.shaders.operator.unary_operator.plus.lowp_float_fragment
 dEQP-GLES3.functional.shaders.operator.unary_operator.plus.mediump_float_vertex
diff --git a/data/gles2/shaders/loops.test b/data/gles2/shaders/loops.test
new file mode 100644 (file)
index 0000000..a4deb3b
--- /dev/null
@@ -0,0 +1,23 @@
+group custom "Custom loop tests"
+
+       case continue_in_fragment_for_loop
+               vertex ""
+                       void main()
+                       {
+                       }
+               ""
+               fragment ""
+                       void main()
+                       {
+                               int count1 = 0;
+                               for(int i=0;i<4;i++)
+                               {
+                                       if (count1 == 2)
+                                               continue;
+                               }
+                               gl_FragColor = vec4(1.0);
+                       }
+               ""
+       end
+
+end # custom
diff --git a/data/gles3/shaders/loops.test b/data/gles3/shaders/loops.test
new file mode 100644 (file)
index 0000000..a8f1e4d
--- /dev/null
@@ -0,0 +1,29 @@
+group custom "Custom loop tests"
+
+       case continue_in_fragment_for_loop
+               version 300 es
+               vertex ""
+                       #version 300 es
+                       ${VERTEX_DECLARATIONS}
+                       void main()
+                       {
+                               ${VERTEX_OUTPUT}
+                       }
+               ""
+               fragment ""
+                       #version 300 es
+                       ${FRAGMENT_DECLARATIONS}
+                       void main()
+                       {
+                               int count1 = 0;
+                               for(int i=0;i<4;i++)
+                               {
+                                       if (count1 == 2)
+                                               continue;
+                               }
+                               ${FRAG_COLOR} = vec4(1.0);
+                       }
+               ""
+       end
+
+end # custom
index db80378..ccfe9f3 100644 (file)
@@ -30,6 +30,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "es2fShaderLoopTests.hpp"
+#include "glsShaderLibrary.hpp"
 #include "glsShaderRenderCase.hpp"
 #include "gluShaderUtil.hpp"
 #include "tcuStringTemplate.hpp"
@@ -1336,6 +1337,11 @@ void ShaderLoopTests::init (void)
                        }
                }
        }
+
+       // Additional smaller handwritten tests.
+       const std::vector<tcu::TestNode*> children = gls::ShaderLibrary(m_context.getTestContext(), m_context.getRenderContext(), m_context.getContextInfo()).loadShaderFile("shaders/loops.test");
+       for (int i = 0; i < (int)children.size(); i++)
+               addChild(children[i]);
 }
 
 } // Functional
index d76bf6a..ff1e09b 100644 (file)
@@ -30,6 +30,7 @@
  *//*--------------------------------------------------------------------*/
 
 #include "es3fShaderLoopTests.hpp"
+#include "glsShaderLibrary.hpp"
 #include "glsShaderRenderCase.hpp"
 #include "gluShaderUtil.hpp"
 #include "tcuStringTemplate.hpp"
@@ -1212,6 +1213,11 @@ void ShaderLoopTests::init (void)
                        }
                }
        }
+
+       // Additional smaller handwritten tests.
+       const std::vector<tcu::TestNode*> children = gls::ShaderLibrary(m_context.getTestContext(), m_context.getRenderContext(), m_context.getContextInfo()).loadShaderFile("shaders/loops.test");
+       for (int i = 0; i < (int)children.size(); i++)
+               addChild(children[i]);
 }
 
 } // Functional