[Piglit] [PATCH] es2_compat: run glReleaseShaderCompiler and use a builtin

Ilia Mirkin imirkin at alum.mit.edu
Sat Feb 6 20:35:22 UTC 2016


All that mesa does when releasing the shader compiler is clear its
builtins list. So make sure to use a builtin, and release the compiler
sooner, to trigger a bug in mesa.

This code sequence is hit by some core Android component.

Reported-by: Rob Herring <robh at kernel.org>
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 .../arb_es2_compatibility-releaseshadercompiler.c                     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
index b5c476e..0abdb5d 100644
--- a/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
+++ b/tests/spec/arb_es2_compatibility/arb_es2_compatibility-releaseshadercompiler.c
@@ -55,7 +55,7 @@ static const char fs_text[] =
 	"#version 100\n"
 	"uniform mediump vec4 color;\n"
 	"void main () {\n"
-	"    gl_FragColor = color;\n"
+	"    gl_FragColor = clamp(color, vec4(0), vec4(1));\n"
 	"}\n"
 	;
 
@@ -67,6 +67,7 @@ draw(const float *color, float x_offset)
 	GLint offset_location;
 
 	prog = piglit_build_simple_program(vs_text, fs_text);
+	glReleaseShaderCompiler();
 
 	glBindAttribLocation(prog, 0, "vertex");
 	glLinkProgram(prog);
@@ -92,7 +93,6 @@ piglit_display(void)
 	float blue[] = {0.0, 0.0, 1.0, 0.0};
 
 	draw(green, 0.0f);
-	glReleaseShaderCompiler();
 	draw(blue, 1.0f);
 
 	pass &= piglit_probe_pixel_rgba(piglit_width / 4, piglit_height / 2,
-- 
2.4.10



More information about the Piglit mailing list