summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/mach64
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/mach64')
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vb.c29
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h22
2 files changed, 14 insertions, 37 deletions
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
index e4d97ad5c5..0bf9afacbf 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c
@@ -184,35 +184,6 @@ void TAG(print_vertex)( GLcontext *ctx, const VERTEX *v )
fprintf(stderr, "\n");
}
-static void do_import( struct vertex_buffer *VB,
- struct gl_client_array *to,
- struct gl_client_array *from )
-{
- GLuint count = VB->Count;
-
- if (!to->Ptr) {
- to->Ptr = ALIGN_MALLOC( VB->Size * 4 * sizeof(GLubyte), 32 );
- to->Type = GL_UNSIGNED_BYTE;
- }
-
- /* No need to transform the same value 3000 times.
- */
- if (!from->StrideB) {
- to->StrideB = 0;
- count = 1;
- }
- else
- to->StrideB = 4 * sizeof(GLubyte);
-
- _math_trans_4ub( (GLubyte (*)[4]) to->Ptr,
- from->Ptr,
- from->StrideB,
- from->Type,
- from->Size,
- 0,
- count);
-}
-
/* Interpolate the elements of the VB not included in typical hardware
* vertices.
*
diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
index 8a36405489..92fa675084 100644
--- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
+++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h
@@ -163,7 +163,8 @@ static void TAG(emit)( GLcontext *ctx,
#if DO_RGBA
STRIDE_4F(col, start * col_stride);
#endif
- coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride);
+ STRIDE_4F(coord, start * coord_stride);
+ /* coord = (GLfloat (*)[4])((GLubyte *)coord + start * coord_stride);*/
}
for (i=start; i < end; i++, v = (VERTEX *)((GLubyte *)v + stride)) {
@@ -269,10 +270,14 @@ static void TAG(emit)( GLcontext *ctx,
#endif
#if DO_RGBA
- *((GLubyte *)p)++ = col[0][2]; /* VERTEX_?_B */
- *((GLubyte *)p)++ = col[0][1]; /* VERTEX_?_G */
- *((GLubyte *)p)++ = col[0][0]; /* VERTEX_?_R */
- *((GLubyte *)p)++ = col[0][3]; /* VERTEX_?_A */
+ UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][2]);
+ *((GLubyte *)p)++;
+ UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][1]);
+ *((GLubyte *)p)++;
+ UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][0]);
+ *((GLubyte *)p)++;
+ UNCLAMPED_FLOAT_TO_UBYTE(*((GLubyte *)p), col[0][3]);
+ *((GLubyte *)p)++;
STRIDE_4F(col, col_stride);
#else
p++;
@@ -282,8 +287,8 @@ static void TAG(emit)( GLcontext *ctx,
if (mask[i] == 0) {
/* unclipped */
LE32_OUT( p,
- (VIEWPORT_X( coord[0][0] ) << 16) | /* VERTEX_?_X */
- (VIEWPORT_Y( coord[0][1] ) & 0xffff) ); /* VERTEX_?_Y */
+ (VIEWPORT_X( coord[i][0] ) << 16) | /* VERTEX_?_X */
+ (VIEWPORT_Y( coord[i][1] ) & 0xffff) ); /* VERTEX_?_Y */
if (MACH64_DEBUG & DEBUG_VERBOSE_PRIMS) {
fprintf( stderr, "%s: vert (importable) %d: %.2f %.2f %.2f %x\n",
@@ -297,7 +302,8 @@ static void TAG(emit)( GLcontext *ctx,
}
#endif
#if DO_TEX1 || DO_TEX0 || DO_XYZW
- coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);
+ STRIDE_4F(coord, start * coord_stride);
+ /* coord = (GLfloat (*)[4])((GLubyte *)coord + coord_stride);*/
#endif
assert( p + 1 - (CARD32 *)v == 10 );