summaryrefslogtreecommitdiff
path: root/tests/shaders
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2016-08-24 20:14:44 +0100
committerIan Romanick <ian.d.romanick@intel.com>2016-09-01 10:59:05 -0700
commite6a151baa18cfe48b5142a634af482f3b55fd908 (patch)
treed98df736e20ec89bec50172c03592dcc855236ab /tests/shaders
parent89c8851d2227fde3aeda3682fd148f96c750be68 (diff)
built-in-constants: Add geometry shader #extension work-around for ES
I thought I had this in my previous series, but I cannot find any trace of it. Prevents a regression in tests/spec/glsl-es-3.10/minimum-maximums.txt after GL_OES_geometry_shader is enabled. It also fixes tests/spec/oes_geometry_shader/minimum-maximums.txt v2: Add extension enables to the passthrough shader too. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'tests/shaders')
-rw-r--r--tests/shaders/built-in-constants.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c
index 41d0a99f3..5791c7c6a 100644
--- a/tests/shaders/built-in-constants.c
+++ b/tests/shaders/built-in-constants.c
@@ -462,6 +462,17 @@ piglit_init(int argc, char **argv)
} else if (glsl_version < required_glsl_version)
piglit_report_result(PIGLIT_SKIP);
+ /* Geometry shaders must use the #extension directive in GLSL ES
+ * before version 3.20.
+ */
+ if (es_shader && required_glsl_version < 320 &&
+ piglit_is_extension_supported("GL_OES_geometry_shader")) {
+ assert(num_required_extensions < ARRAY_SIZE(required_extensions));
+ required_extensions[num_required_extensions] =
+ strdup("GL_OES_geometry_shader");
+ num_required_extensions++;
+ }
+
/* Tessellation shaders must use the #extension directive. */
const char *const tess_ext_name = es_shader
? "GL_OES_tessellation_shader"
@@ -522,10 +533,12 @@ piglit_init(int argc, char **argv)
(void)!asprintf(&passthrough_version_string,
"#version %s\n"
+ "%s"
"#ifdef GL_ES\n"
"precision mediump float;\n"
"#endif\n",
- required_glsl_version_string);
+ required_glsl_version_string,
+ extension_enables);
/* Create the shaders that will be used for the real part of the test.