From 575700fbdcdde9c31ee6ccdd0369604b8ee2df91 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 16 Dec 2004 03:07:18 +0000 Subject: Experimental PRINT instruction for NV_vertex_program. Basically, this lets you put a "PRINT 'mesage', register;" statement in a vertex program to aid in debugging. --- src/mesa/shader/program.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa/shader/program.c') diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index c2f4b146b6c..ca0421181ce 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -39,6 +39,7 @@ #include "nvfragparse.h" #include "nvfragprog.h" #include "nvvertparse.h" +#include "nvvertprog.h" /**********************************************************************/ @@ -263,8 +264,14 @@ _mesa_delete_program(GLcontext *ctx, struct program *prog) if (prog->Target == GL_VERTEX_PROGRAM_NV || prog->Target == GL_VERTEX_STATE_PROGRAM_NV) { struct vertex_program *vprog = (struct vertex_program *) prog; - if (vprog->Instructions) + if (vprog->Instructions) { + GLuint i; + for (i = 0; i < vprog->Base.NumInstructions; i++) { + if (vprog->Instructions[i].Data) + _mesa_free(vprog->Instructions[i].Data); + } _mesa_free(vprog->Instructions); + } if (vprog->Parameters) _mesa_free_parameter_list(vprog->Parameters); } -- cgit v1.2.3