summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2002-09-17 15:46:34 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2002-09-17 15:46:34 +0000
commita9be374f82ace523c126c661399030c869201dab (patch)
tree9aea742129bab4b8dad092cdf9084962b7a57d67 /src/mesa/drivers/common
parente1cb2fb571ee47b59020db7627e554b7d227e454 (diff)
pull-in changes from DRI/Mesa-4.0.4
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/t_dd_vb.c75
-rw-r--r--src/mesa/drivers/common/t_dd_vbtmp.h37
2 files changed, 85 insertions, 27 deletions
diff --git a/src/mesa/drivers/common/t_dd_vb.c b/src/mesa/drivers/common/t_dd_vb.c
index f4cfe7c524..3ba8fb3d8b 100644
--- a/src/mesa/drivers/common/t_dd_vb.c
+++ b/src/mesa/drivers/common/t_dd_vb.c
@@ -1,4 +1,3 @@
-/* $Id: t_dd_vb.c,v 1.16 2001/12/13 10:51:41 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -195,22 +194,78 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
LOCALVARS
GLuint format = GET_VERTEX_FORMAT();
- if (format == TINY_VERTEX_FORMAT) {
- fprintf(stderr, "x %f y %f z %f\n", v->v.x, v->v.y, v->v.z);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ fprintf(stderr, "(%x) ", format);
+
+ switch (format) {
+#if HAVE_TINY_VERTICES
+ case TINY_VERTEX_FORMAT:
+ fprintf(stderr, "xyz %.4f,%.4f,%.4f rgba %x:%x:%x:%x\n",
+ v->v.x, v->v.y, v->v.z,
v->tv.color.red,
v->tv.color.green,
v->tv.color.blue,
v->tv.color.alpha);
- }
- else {
- fprintf(stderr, "x %f y %f z %f oow %f\n",
- v->v.x, v->v.y, v->v.z, v->v.w);
- fprintf(stderr, "r %d g %d b %d a %d\n",
+ break;
+#endif
+#if HAVE_NOTEX_VERTICES
+ case NOTEX_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x spec %x:%x:%x:%x\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.specular.red,
+ v->v.specular.green,
+ v->v.specular.blue,
+ v->v.specular.alpha);
+ break;
+#endif
+#if HAVE_TEX0_VERTICES
+ case TEX0_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.u0,
+ v->v.v0);
+ break;
+#endif
+#if HAVE_TEX1_VERTICES
+ case TEX1_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x st %.4f,%.4f st %.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
+ v->v.color.red,
+ v->v.color.green,
+ v->v.color.blue,
+ v->v.color.alpha,
+ v->v.u0,
+ v->v.v0,
+ v->v.u1,
+ v->v.u2);
+ break;
+#endif
+#if HAVE_PTEX_VERTICES
+ case PROJ_TEX1_VERTEX_FORMAT:
+ fprintf(stderr, "xyzw %.4f,%.4f,%.4f,%.4f rgba %x:%x:%x:%x stq %.4f,%.4f,%.4f stq %.4f,%.4f,%.4f\n",
+ v->v.x, v->v.y, v->v.z, v->v.w,
v->v.color.red,
v->v.color.green,
v->v.color.blue,
- v->v.color.alpha);
+ v->v.color.alpha,
+ v->pv.u0,
+ v->pv.v0,
+ v->pv.q0,
+ v->pv.u1,
+ v->pv.v1,
+ v->pv.q1);
+ break;
+#endif
+ default:
+ fprintf(stderr, "???\n");
+ break;
}
fprintf(stderr, "\n");
diff --git a/src/mesa/drivers/common/t_dd_vbtmp.h b/src/mesa/drivers/common/t_dd_vbtmp.h
index c8b82ec2c4..39c496509b 100644
--- a/src/mesa/drivers/common/t_dd_vbtmp.h
+++ b/src/mesa/drivers/common/t_dd_vbtmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_dd_vbtmp.h,v 1.19 2002/08/21 02:59:00 brianp Exp $ */
+/* $Id: t_dd_vbtmp.h,v 1.20 2002/09/17 15:46:37 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -61,7 +61,10 @@
* unsigned char ub4[4][16];
* }
*
-
+
+ * VERTEX: hw vertex type as above
+ * VERTEX_COLOR: hw color struct type in VERTEX
+ *
* DO_XYZW: Emit xyz and maybe w coordinates.
* DO_RGBA: Emit color.
* DO_SPEC: Emit specular color.
@@ -459,11 +462,11 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
*(GLuint *)&v[3] = LE32_TO_CPU(*(GLuint *)col);
}
else {
- GLubyte *b = (GLubyte *)&v[3];
- b[0] = col[0][2];
- b[1] = col[0][1];
- b[2] = col[0][0];
- b[3] = col[0][3];
+ VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3];
+ c->blue = col[0][2];
+ c->green = col[0][1];
+ c->red = col[0][0];
+ c->alpha = col[0][3];
}
STRIDE_4UB( col, col_stride );
}
@@ -483,11 +486,11 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
*(GLuint *)&v[3] = LE32_TO_CPU(*(GLuint *)&col[i]);
}
else {
- GLubyte *b = (GLubyte *)&v[3];
- b[0] = col[i][2];
- b[1] = col[i][1];
- b[2] = col[i][0];
- b[3] = col[i][3];
+ VERTEX_COLOR *c = (VERTEX_COLOR *)&v[3];
+ c->blue = col[i][2];
+ c->green = col[i][1];
+ c->red = col[i][0];
+ c->alpha = col[i][3];
}
}
/* fprintf(stderr, "vert %d: %.2f %.2f %.2f %x\n", */
@@ -528,11 +531,11 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end,
*(GLuint *)v = LE32_TO_CPU(*(GLuint *)col[0]);
}
else {
- GLubyte *b = (GLubyte *)v;
- b[0] = col[0][2];
- b[1] = col[0][1];
- b[2] = col[0][0];
- b[3] = col[0][3];
+ VERTEX_COLOR *c = (VERTEX_COLOR *)v;
+ c->blue = col[0][2];
+ c->green = col[0][1];
+ c->red = col[0][0];
+ c->alpha = col[0][3];
}
STRIDE_4UB( col, col_stride );
}