[Piglit] [PATCH] Fix GetProgramPipelineiv test with GLSL 4.30+.

Kenneth Graunke kenneth at whitecape.org
Wed Jun 1 01:39:01 UTC 2016


The test was set up to use GLSL 4.30, 1.50, or 1.10, as available.

GLSL 4.20 removes the gl_FragColor variable, so the fragment shader
would fail to compile if GLSL 4.30 was available.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96301
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mark.a.janes at intel.com
---
 tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
index 1975180..2746e8b 100644
--- a/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
+++ b/tests/spec/arb_separate_shader_objects/GetProgramPipelineiv.c
@@ -119,9 +119,14 @@ piglit_init(int argc, char **argv)
 		"    gl_Position = position;\n"
 		"}\n";
 	static const char fs_source[] =
+		"#if __VERSION__ >= 430\n"
+		"layout(location = 0) out vec4 color;\n"
+		"#else\n"
+		"#define color gl_FragColor\n"
+		"#endif\n"
 		"void main()\n"
 		"{\n"
-		"    gl_FragColor = vec4(0.0, 1.0, 0.0, 0.0);\n"
+		"    color = vec4(0.0, 1.0, 0.0, 0.0);\n"
 		"}\n";
 	static const char gs_source[] =
 		"/* At least some versions of AMD's closed-source driver\n"
-- 
2.8.3



More information about the Piglit mailing list