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.
This commit is contained in:
Brian Paul
2004-12-16 03:07:18 +00:00
parent c75900e7a2
commit 575700fbdc
5 changed files with 149 additions and 8 deletions

View File

@@ -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);
}