From 32342df30e0eb2235c173b90855ed372acb647c6 Mon Sep 17 00:00:00 2001 From: Alexander Galazin Date: Wed, 12 Jul 2017 14:38:01 +0200 Subject: [PATCH] Report Android extension pack tests as not supported Android extension pack tests can't run on GLES31-only GPUs. Report such tests as NotSupported. Components: AOSP Change-Id: I88ab61e5d0b263428c41a644c6417e24e2f7f234 (cherry picked from commit 71b18bb8898a12d095e19f8b1d5b98d343282240) --- .../gles31/functional/es31fNegativeComputeTests.cpp | 6 ++++++ .../functional/es31fNegativeVertexArrayApiTests.cpp | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/modules/gles31/functional/es31fNegativeComputeTests.cpp b/modules/gles31/functional/es31fNegativeComputeTests.cpp index 7aeee99..eb2e0ec 100644 --- a/modules/gles31/functional/es31fNegativeComputeTests.cpp +++ b/modules/gles31/functional/es31fNegativeComputeTests.cpp @@ -800,6 +800,12 @@ void invalid_layout_qualifiers (NegativeTestContext& ctx) void invalid_write_built_in_constants (NegativeTestContext& ctx) { + if ((!ctx.isExtensionSupported("GL_EXT_tessellation_shader") && !ctx.isExtensionSupported("GL_OES_tessellation_shader")) || + (!ctx.isExtensionSupported("GL_EXT_geometry_shader") && !ctx.isExtensionSupported("GL_OES_geometry_shader"))) + { + TCU_THROW(NotSupportedError, "tessellation and geometry shader extensions not supported"); + } + const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); map args; diff --git a/modules/gles31/functional/es31fNegativeVertexArrayApiTests.cpp b/modules/gles31/functional/es31fNegativeVertexArrayApiTests.cpp index ffad380..56340d9 100644 --- a/modules/gles31/functional/es31fNegativeVertexArrayApiTests.cpp +++ b/modules/gles31/functional/es31fNegativeVertexArrayApiTests.cpp @@ -721,10 +721,11 @@ void draw_elements_base_vertex_invalid_map (NegativeTestContext& ctx) void draw_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx) { + TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version."); + GLfloat vertices[1]; map args; - const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); - args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES); + args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES); glu::ShaderProgram program(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource)); @@ -1105,10 +1106,11 @@ void draw_elements_instanced_base_vertex_invalid_map (NegativeTestContext& ctx) void draw_elements_instanced_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx) { + TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version."); + GLfloat vertices[1]; map args; - const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); - args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES); + args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES); glu::ShaderProgram geometryProgram(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource)); ctx.beginSection("GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object."); @@ -1325,11 +1327,10 @@ void draw_range_elements_base_vertex (NegativeTestContext& ctx) { TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version."); - const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); GLuint fbo = 0; GLfloat vertices[1]; map args; - args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES); + args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES); glu::ShaderProgram program (ctx.getRenderContext(), glu::makeVtxFragSources(tcu::StringTemplate(vertexShaderSource).specialize(args), tcu::StringTemplate(fragmentShaderSource).specialize(args))); ctx.glUseProgram(program.getProgram()); @@ -1390,10 +1391,11 @@ void draw_range_elements_base_vertex_invalid_map (NegativeTestContext& ctx) void draw_range_elements_base_vertex_primitive_mode_mismatch (NegativeTestContext& ctx) { + TCU_CHECK_AND_THROW(NotSupportedError, contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)), "This test requires a 3.2 context or higher context version."); + GLfloat vertices[1]; map args; - const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); - args["GLSL_VERSION_STRING"] = isES32 ? getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES) : getGLSLVersionDeclaration(glu::GLSL_VERSION_310_ES); + args["GLSL_VERSION_STRING"] = getGLSLVersionDeclaration(glu::GLSL_VERSION_320_ES); glu::ShaderProgram geometryProgram(ctx.getRenderContext(), glu::ProgramSources() << glu::ProgramSeparable(true) << glu::VertexSource(tcu::StringTemplate(vertexShaderSource).specialize(args)) << glu::GeometrySource(geometryShaderSource)); ctx.beginSection("GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the currently installed program object."); -- 2.7.4