[Piglit] [PATCH] built-in-constants: don't try to create GS with version < 150.

Paul Berry stereotype441 at gmail.com
Sat Oct 12 19:11:19 CEST 2013


Previously, built-in-constants looked at required_glsl_version to
determine what to include in the "#version" directive, but it looked
at glsl_version (the maximum version supported by the implementation)
to decide whether to test geometry shaders.  As a result, it when
testing a built-in constant whose required_glsl_version was less than
150, it would try to create a geometry shader using a "#version"
directive less than 150, leading to GL errors.

This patch prevents the problem by only testing geometry shaders when
required_glsl_version >= 150.
---
 tests/shaders/built-in-constants.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c
index 06850b5..3a2a784 100644
--- a/tests/shaders/built-in-constants.c
+++ b/tests/shaders/built-in-constants.c
@@ -350,7 +350,7 @@ piglit_init(int argc, char **argv)
 	test_vs = glCreateShader(GL_VERTEX_SHADER);
 	test_fs = glCreateShader(GL_FRAGMENT_SHADER);
 
-	if (glsl_version >= 150)
+	if (required_glsl_version >= 150)
 		test_gs = glCreateShader(GL_GEOMETRY_SHADER);
 
 	for (i = 0; i < num_tests; i++) {
-- 
1.8.4



More information about the Piglit mailing list