[Piglit] [PATCH 2/6] shader_runner: Don't call glDeleteProgram on an ARB program.

Matt Turner mattst88 at gmail.com
Tue Nov 10 22:46:19 PST 2015


I don't feel good about this check, but it is done elsewhere in the same
file ("prog == 0").
---
 tests/shaders/shader_runner.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 4597b46..bb17381 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -3081,8 +3081,12 @@ piglit_display(void)
 	if (piglit_automatic) {
 	        free_subroutine_uniforms();
 		/* Free our resources, useful for valgrinding. */
-		glDeleteProgram(prog);
-		glUseProgram(0);
+		if (prog != 0) {
+			glDeleteProgram(prog);
+			glUseProgram(0);
+		} else {
+			glDeleteProgramsARB(1, &prog);
+		}
 	}
 
 	return pass ? PIGLIT_PASS : PIGLIT_FAIL;
-- 
2.4.9



More information about the Piglit mailing list