Modify single_tessellation_stage to check for GL_NV_gpu_shader5
authorMark Adams <marka@nvidia.com>
Thu, 2 Mar 2017 15:19:49 +0000 (10:19 -0500)
committerMark Adams <marka@nvidia.com>
Thu, 2 Mar 2017 15:19:49 +0000 (10:19 -0500)
That extension permits the use of a tessellation control shader
without a tessellation evaluation shader. Affected tests:

dEQP-GLES31.functional.debug.negative_coverage.*.tessellation.single_tessellation_stage

modules/gles31/functional/es31fNegativeTessellationTests.cpp

index e42f94a..39c9b32 100644 (file)
@@ -109,6 +109,7 @@ static glu::ProgramSources makeTessPipelineSources (const std::string& vertexSrc
 void single_tessellation_stage (NegativeTestContext& ctx)
 {
        const bool                                      isES32  = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2));
+       const bool                                      requireTES = !ctx.getContextInfo().isExtensionSupported("GL_NV_gpu_shader5");
        map<string, string>                     args;
        args["GLSL_VERSION_STRING"]                     = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES);
        args["GLSL_TESS_EXTENSION_STRING"]      = isES32 ? "" : "#extension GL_EXT_tessellation_shader : require";
@@ -124,10 +125,12 @@ void single_tessellation_stage (NegativeTestContext& ctx)
                tcu::TestLog& log = ctx.getLog();
                log << program;
 
-               ctx.beginSection("A link error is generated if a non-separable program has a tessellation control shader but no tessellation evaluation shader.");
+               ctx.beginSection("A link error is generated if a non-separable program has a tessellation control shader but no tessellation evaluation shader, unless GL_NV_gpu_shader5 is supported.");
 
-               if (program.isOk())
+               if (requireTES && program.isOk())
                        ctx.fail("Program was not expected to link");
+               else if (!requireTES && !program.isOk())
+                       ctx.fail("Program was expected to link");
 
                ctx.endSection();
        }
@@ -148,9 +151,9 @@ void single_tessellation_stage (NegativeTestContext& ctx)
                ctx.glUseProgram(program.getProgram());
                ctx.expectError(GL_NO_ERROR);
 
-               ctx.beginSection("GL_INVALID_OPERATION is generated if current program state has tessellation control shader but no tessellation evaluation shader.");
+               ctx.beginSection("GL_INVALID_OPERATION is generated if current program state has tessellation control shader but no tessellation evaluation shader, unless GL_NV_gpu_shader5 is supported.");
                ctx.glDrawArrays(GL_PATCHES, 0, 3);
-               ctx.expectError(GL_INVALID_OPERATION);
+               ctx.expectError(requireTES ? GL_INVALID_OPERATION : GL_NO_ERROR);
                ctx.endSection();
 
                ctx.glUseProgram(0);