Extend primitive_bounding_box negative tests
authorJohn Richardson <john.richardson@mobica.com>
Tue, 1 Nov 2016 13:06:53 +0000 (13:06 +0000)
committerPyry Haulos <phaulos@google.com>
Wed, 14 Dec 2016 10:43:47 +0000 (10:43 +0000)
    Tests groups added to
    - dEQP-GLES31.functional.debug.negative_coverage.*.

    Extended tests:
    - shader_directive.primitive_bounding_box

Change-Id: I38b698e3bd594f71b15d3bce4dc9a809298eb95e

modules/gles31/functional/es31fNegativeShaderDirectiveTests.cpp

index 2b544624704b6ba7ddbb4e4676f7aa4c3ef6bf49..f3b5ac43e8a8e5565aed458983691127042d848a 100644 (file)
@@ -126,14 +126,42 @@ void primitive_bounding_box (NegativeTestContext& ctx)
        if (contextSupports(ctx.getRenderContext().getType() , glu::ApiType::es(3, 2)))
        {
                ctx.beginSection("gl_BoundingBox does not require the OES/EXT suffix in a 320 es shader.");
-               const std::string source =      "#version 320 es\n"
-                                                                       "layout(vertices = 3) out;\n"
-                                                                       "void main()\n"
-                                                                       "{\n"
-                                                                       "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
-                                                                       "       gl_BoundingBox[1] = vec4(0.0, 0.0, 0.0, 0.0);\n"
-                                                                       "}\n";
-               verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_PASS);
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "       gl_BoundingBox[1] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_PASS);
+               }
+               ctx.endSection();
+
+               ctx.beginSection("Invalid index used when assigning to gl_BoundingBox in 320 es shader.");
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "       gl_BoundingBox[2] = vec4(0.0, 0.0, 0.0, 0.0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_FAIL);
+               }
+               ctx.endSection();
+
+               ctx.beginSection("Invalid type assignment to per-patch output array in 320 es shader.");
+               {
+                       const std::string source =      "#version 320 es\n"
+                                                                               "layout(vertices = 3) out;\n"
+                                                                               "void main()\n"
+                                                                               "{\n"
+                                                                               "       gl_BoundingBox[0] = ivec4(0, 0, 0, 0);\n"
+                                                                               "       gl_BoundingBox[1] = ivec4(0, 0, 0, 0);\n"
+                                                                               "}\n";
+                       verifyShader(ctx, glu::SHADERTYPE_TESSELLATION_CONTROL, source, EXPECT_RESULT_FAIL);
+               }
                ctx.endSection();
        }
 }