-/* $Id: nvvertparse.c,v 1.4 2003/03/14 15:40:59 brianp Exp $ */
+/* $Id: nvvertparse.c,v 1.5 2003/03/29 16:38:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
program->OutputsWritten = parseState.outputsWritten;
program->IsPositionInvariant = parseState.isPositionInvariant;
-#ifdef DEBUG_foo
+#ifdef DEBUG
_mesa_printf("--- glLoadProgramNV result ---\n");
_mesa_print_nv_vertex_program(program);
_mesa_printf("------------------------------\n");
/**
- * Print (unparse) the given vertex program. Just for debugging.
+ * Print a single NVIDIA vertex program instruction.
*/
void
-_mesa_print_nv_vertex_program(const struct vertex_program *program)
+_mesa_print_nv_vertex_instruction(const struct vp_instruction *inst)
{
- const struct vp_instruction *inst;
-
- for (inst = program->Instructions; ; inst++) {
- switch (inst->Opcode) {
+ switch (inst->Opcode) {
case VP_OPCODE_MOV:
case VP_OPCODE_LIT:
case VP_OPCODE_RCP:
break;
case VP_OPCODE_END:
_mesa_printf("END\n");
- return;
+ break;
default:
_mesa_printf("BAD INSTRUCTION\n");
- }
+ }
+}
+
+
+/**
+ * Print (unparse) the given vertex program. Just for debugging.
+ */
+void
+_mesa_print_nv_vertex_program(const struct vertex_program *program)
+{
+ const struct vp_instruction *inst;
+
+ for (inst = program->Instructions; ; inst++) {
+ _mesa_print_nv_vertex_instruction(inst);
+ if (inst->Opcode == VP_OPCODE_END)
+ return;
}
}
-/* $Id: nvvertparse.h,v 1.1 2003/01/14 04:55:46 brianp Exp $ */
+/* $Id: nvvertparse.h,v 1.2 2003/03/29 16:38:08 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
const GLubyte *str, GLsizei len,
struct vertex_program *program);
+extern void
+_mesa_print_nv_vertex_instruction(const struct vp_instruction *inst);
extern void
_mesa_print_nv_vertex_program(const struct vertex_program *program);