summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/savage
diff options
context:
space:
mode:
authorFelix Kuehling <fxkuehl@gmx.de>2004-02-26 12:19:41 +0000
committerFelix Kuehling <fxkuehl@gmx.de>2004-02-26 12:19:41 +0000
commit76283a9079846e8b31c03719774b7d2e24832e48 (patch)
tree32c9c9909dfdcf62d3e971fe413cd55619065191 /src/mesa/drivers/dri/savage
parent229654d815766c732e45b0de70485b0bed5121fd (diff)
Adapt the VERT_SET/COPY/SAVE/RESTORE_RGBA/SPEC macros to copy with all savage vertex formats.
Diffstat (limited to 'src/mesa/drivers/dri/savage')
-rw-r--r--src/mesa/drivers/dri/savage/savagetris.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c
index 025c469a55..9d546bbf5d 100644
--- a/src/mesa/drivers/dri/savage/savagetris.c
+++ b/src/mesa/drivers/dri/savage/savagetris.c
@@ -319,17 +319,23 @@ do { \
#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset]
#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx]
-#define VERT_SET_SPEC( v, c ) if (havespec) SAVAGE_SPEC( v->ub4[5], c )
-#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5])
-#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5]
-#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx]
+#define VERT_SET_SPEC( v, c ) \
+ if (specoffset) SAVAGE_SPEC( v->ub4[specoffset], c )
+#define VERT_COPY_SPEC( v0, v1 ) \
+ if (specoffset) COPY_3V(v0->ub4[specoffset], v1->ub4[specoffset])
+#define VERT_SAVE_SPEC( idx ) \
+ if (specoffset) spec[idx] = v[idx]->ui[specoffset]
+#define VERT_RESTORE_SPEC( idx ) \
+ if (specoffset) v[idx]->ui[specoffset] = spec[idx]
#define LOCAL_VARS(n) \
savageContextPtr imesa = SAVAGE_CONTEXT(ctx); \
GLuint color[n], spec[n]; \
- GLuint coloroffset = 4/*(rmesa->vertex_size == 4 ? 3 : 4)*/; \
- GLboolean havespec = 1/*(rmesa->vertex_size == 4 ? 0 : 1)*/; \
- (void) color; (void) spec; (void) coloroffset; (void) havespec;
+ GLuint coloroffset = \
+ ((imesa->DrawPrimitiveCmd & SAVAGE_HW_NO_W) ? 3 : 4); \
+ GLboolean specoffset = \
+ ((imesa->DrawPrimitiveCmd & SAVAGE_HW_NO_CS) ? 0 : coloroffset+1);\
+ (void) color; (void) spec; (void) coloroffset; (void) specoffset;
/***********************************************************************
* Helpers for rendering unfilled primitives *