From 7c26b61f9366a397e353d7b7f1f1d1f6d0dcd0c7 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 21 Apr 2005 14:46:57 +0000 Subject: Reduce the size of mesa's internal fragment and vertex program representations by switching to packed structures for registers and instructions. --- src/mesa/shader/arbvertparse.c | 208 ++++++++++++++++++----------------------- 1 file changed, 91 insertions(+), 117 deletions(-) (limited to 'src/mesa/shader/arbvertparse.c') diff --git a/src/mesa/shader/arbvertparse.c b/src/mesa/shader/arbvertparse.c index fd0666b326..5545aff8b7 100644 --- a/src/mesa/shader/arbvertparse.c +++ b/src/mesa/shader/arbvertparse.c @@ -37,6 +37,7 @@ #include "imports.h" #include "macros.h" #include "mtypes.h" +#include "program.h" #include "nvprogram.h" #include "nvvertparse.h" #include "nvvertprog.h" @@ -48,129 +49,104 @@ * XXX this is probably redundant. We've already got code like this * in the nvvertparse.c file. Combine/clean-up someday. */ -static GLvoid -debug_vp_inst(GLint num, struct vp_instruction *vp) +void _mesa_debug_vp_inst(GLint num, struct vp_instruction *vp) { GLint a; + static const char *opcode_string[] = { + "ABS", + "ADD", + "ARL", + "DP3", + "DP4", + "DPH", + "DST", + "END", /* Placeholder */ + "EX2", /* ARB only */ + "EXP", + "FLR", /* ARB */ + "FRC", /* ARB */ + "LG2", /* ARB only */ + "LIT", + "LOG", + "MAD", + "MAX", + "MIN", + "MOV", + "MUL", + "POW", /* ARB only */ + "PRINT", /* Mesa only */ + "RCC", + "RCP", + "RSQ", + "SGE", + "SLT", + "SUB", + "SWZ", /* ARB only */ + "XPD" /* ARB only */ + }; + + static const char *file_string[] = { + "TEMP", + "INPUT", + "OUTPUT", + "LOCAL", + "ENV", + "NAMED", + "STATE", + "WRITE_ONLY", + "ADDR" + }; + + static const char swz[] = "xyzw01??"; for (a=0; aInstructions = ap.VPInstructions; #if DEBUG_VP - debug_vp_inst(ap.Base.NumInstructions, ap.VPInstructions); -#else - (void) debug_vp_inst; + _mesa_debug_vp_inst(ap.Base.NumInstructions, ap.VPInstructions); #endif } -- cgit v1.2.3