From ff3a5b1842bf26783a487674c5ff4cb40f405f25 Mon Sep 17 00:00:00 2001 From: Tilman Sauerbeck Date: Thu, 29 Jun 2006 16:48:45 +0000 Subject: [PATCH] instead of messing with _TNL_LAST_GENERIC and _TNL_FIRST_GENERIC, use _TNL_NUM_GENERIC. this fixes an off-by-one error (we didn't handle the final attribute) --- src/mesa/drivers/dri/r300/r300_context.h | 2 +- src/mesa/drivers/dri/r300/r300_maos.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 0f3683fc09a..e1d5b085806 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -544,7 +544,7 @@ struct r300_vap_reg_state { int i_color[2]; int i_fog; int i_tex[R300_MAX_TEXTURE_UNITS]; - int i_attrib[_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC]; + int i_attrib[_TNL_NUM_GENERIC]; int i_index; int i_pointsize; }; diff --git a/src/mesa/drivers/dri/r300/r300_maos.c b/src/mesa/drivers/dri/r300/r300_maos.c index 9cdcb414be5..bea58c9a4fc 100644 --- a/src/mesa/drivers/dri/r300/r300_maos.c +++ b/src/mesa/drivers/dri/r300/r300_maos.c @@ -368,7 +368,7 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd) rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_TEX0+i]; } } - for (i=0;i<(_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC);i++) { + for (i = 0; i < _TNL_NUM_GENERIC; i++) { if (InputsRead & (1<<(VERT_ATTRIB_GENERIC0+i))) { RENDERINPUTS_SET( inputs_bitset, _TNL_ATTRIB_GENERIC(i) ); rmesa->state.aos[nr++].aos_reg = prog->inputs[VERT_ATTRIB_GENERIC0+i]; @@ -463,7 +463,8 @@ void r300EmitArrays(GLcontext * ctx, GLboolean immd) r300->state.texture.tc_count++; } } - for (i = 0; i < (_TNL_LAST_GENERIC-_TNL_FIRST_GENERIC); i++) { + + for (i = 0; i < _TNL_NUM_GENERIC; i++) { if (RENDERINPUTS_TEST( inputs_bitset, _TNL_ATTRIB_GENERIC(i) )) { CONFIGURE_AOS(i_attrib[i], AOS_FORMAT_FLOAT, VB->AttribPtr[VERT_ATTRIB_GENERIC0+i], -- 2.30.2