[Piglit] [PATCH 4/6] built-in-constants: Separate tessellation and geometry shader checks for desktop and ES

Ian Romanick idr at freedesktop.org
Thu Jul 21 19:04:21 UTC 2016


From: Ian Romanick <ian.d.romanick at intel.com>

Previous to this, running the test on OpenGL ES 3.1 would generate
spurious warnings from Mesa:

    Mesa: User error: GL_INVALID_ENUM in CreateShader(GL_GEOMETRY_SHADER)

This fixes that in a way that is understandable.  It also allows the
desktop geometry shader check to be simplified.

This also prevents spurious failures when we enable
GL_OES_geometry_shaders in Mesa.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 tests/shaders/built-in-constants.c | 32 +++++++++++++++++++++++++-------
 1 file changed, 25 insertions(+), 7 deletions(-)

diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c
index b1951fb..be4eb64 100644
--- a/tests/shaders/built-in-constants.c
+++ b/tests/shaders/built-in-constants.c
@@ -376,13 +376,31 @@ create_shader(GLenum type)
 {
 	if (shader_type != 0 && shader_type != type && !is_tessellation_type(shader_type))
 		return 0;
-	if (is_tessellation_type(type) &&
-	    (required_glsl_version < 400 &&
-	     !piglit_is_extension_supported("GL_ARB_tessellation_shader")))
-		return 0;
-	if (type == GL_GEOMETRY_SHADER &&
-	    (required_glsl_version < 150 || required_glsl_version == 300))
-		return 0;
+	if (es_shader) {
+		if (is_tessellation_type(type) &&
+		    required_glsl_version < 320 &&
+		    (required_glsl_version < 310 ||
+		     !piglit_is_extension_supported("GL_OES_tessellation_shader")))
+			return 0;
+
+		if (type == GL_GEOMETRY_SHADER &&
+		    required_glsl_version < 320 &&
+		    (required_glsl_version < 310 ||
+		     !piglit_is_extension_supported("GL_OES_geometry_shader")))
+			return 0;
+	} else {
+		if (is_tessellation_type(type) &&
+		    (required_glsl_version < 400 &&
+		     !piglit_is_extension_supported("GL_ARB_tessellation_shader")))
+			return 0;
+
+		/* Only support geometry shaders on desktop as introduced in
+		 * OpenGL 3.2.
+		 */
+		if (type == GL_GEOMETRY_SHADER &&
+		    required_glsl_version < 320)
+			return 0;
+	}
 	/* Only create compute shaders when explicitly requested
 	 */
 	if (type == GL_COMPUTE_SHADER && shader_type != type)
-- 
2.5.5



More information about the Piglit mailing list