From bd9b2be8284fda3f8aac235908ded118b5648a38 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 8 Mar 2009 17:58:54 -0600 Subject: mesa: texture combine clean-ups Use MAX_COMBINER_TERMS instead of 4. Rename some vars. Update comments. --- src/mesa/main/texenvprogram.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src/mesa/main/texenvprogram.c') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 3fbd119b347..4a124bf27e2 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -39,9 +39,6 @@ #include "texenvprogram.h" -#define MAX_TERMS 4 - - /* * Note on texture units: * @@ -95,11 +92,11 @@ struct state_key { GLuint NumArgsRGB:3; GLuint ModeRGB:5; - struct mode_opt OptRGB[MAX_TERMS]; + struct mode_opt OptRGB[MAX_COMBINER_TERMS]; GLuint NumArgsA:3; GLuint ModeA:5; - struct mode_opt OptA[MAX_TERMS]; + struct mode_opt OptA[MAX_COMBINER_TERMS]; } unit[8]; }; @@ -389,7 +386,7 @@ static void make_state_key( GLcontext *ctx, struct state_key *key ) key->unit[i].ScaleShiftRGB = texUnit->_CurrentCombine->ScaleShiftRGB; key->unit[i].ScaleShiftA = texUnit->_CurrentCombine->ScaleShiftA; - for (j = 0; j < MAX_TERMS; j++) { + for (j = 0; j < MAX_COMBINER_TERMS; j++) { key->unit[i].OptRGB[j].Operand = translate_operand(texUnit->_CurrentCombine->OperandRGB[j]); key->unit[i].OptA[j].Operand = @@ -972,11 +969,11 @@ static struct ureg emit_combine( struct texenv_fragment_program *p, GLuint mode, const struct mode_opt *opt) { - struct ureg src[MAX_TERMS]; + struct ureg src[MAX_COMBINER_TERMS]; struct ureg tmp, half; GLuint i; - assert(nr <= MAX_TERMS); + assert(nr <= MAX_COMBINER_TERMS); tmp = undef; /* silence warning (bug 5318) */ -- cgit v1.2.3