summaryrefslogtreecommitdiffstats
path: root/src/mesa/shader/program.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2004-12-16 03:07:18 +0000
committerBrian Paul <[email protected]>2004-12-16 03:07:18 +0000
commit575700fbdcdde9c31ee6ccdd0369604b8ee2df91 (patch)
tree2bc35036e7f335f2dfa7211334108ce8bd34fbb3 /src/mesa/shader/program.c
parentc75900e7a2ad17ecf832e7e9aa41e714a1a78f2a (diff)
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.
Diffstat (limited to 'src/mesa/shader/program.c')
-rw-r--r--src/mesa/shader/program.c9
1 files changed, 8 insertions, 1 deletions
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);
}