From 29af3b2be65de1f0768fa51637835d115c00772c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 29 Mar 2003 16:38:08 +0000 Subject: added _mesa_print_nv_vertex_instruction() --- src/mesa/main/nvvertparse.c | 32 ++++++++++++++++++++++---------- src/mesa/main/nvvertparse.h | 6 ++++-- 2 files changed, 26 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/mesa/main/nvvertparse.c b/src/mesa/main/nvvertparse.c index a84eb34071..ed38dc65b9 100644 --- a/src/mesa/main/nvvertparse.c +++ b/src/mesa/main/nvvertparse.c @@ -1,4 +1,4 @@ -/* $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 @@ -1291,7 +1291,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, 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"); @@ -1394,15 +1394,12 @@ PrintDstReg(const struct vp_dst_register *dst) /** - * 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: @@ -1454,10 +1451,25 @@ _mesa_print_nv_vertex_program(const struct vertex_program *program) 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; } } diff --git a/src/mesa/main/nvvertparse.h b/src/mesa/main/nvvertparse.h index 3901014395..b46fa35bf0 100644 --- a/src/mesa/main/nvvertparse.h +++ b/src/mesa/main/nvvertparse.h @@ -1,10 +1,10 @@ -/* $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"), @@ -37,6 +37,8 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum target, 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); -- cgit v1.2.3