summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r128
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2003-12-11 16:25:36 +0000
committerKeith Whitwell <[email protected]>2003-12-11 16:25:36 +0000
commit2dc621f3fdb585f23013aa3e220f2148f9405538 (patch)
treed4eb6b4a76b427143e88953bbec0284bf15e3ffc /src/mesa/drivers/dri/r128
parent5bcf52b4d6951f9058b5ef00cf2438b3bdfbeea0 (diff)
Updates to tnl_dd_dmatmp.h
- Allocate vertices explicitly, rather than trying to talk about dma buffers. - Clean up the various Flush() operations. - Don't allow fallbacks any longer. Provide a support function to detect them ahead o ftime Updates to tnl_dd_vbtmp.h - Get rid of power-of-two vertex strides. Pack all vertices tightly. - Get texunit 2,3 emit working coorrectly. Other stuff: - Get rid of lingering Ubyte color support. - Fix a few compiler warnings.
Diffstat (limited to 'src/mesa/drivers/dri/r128')
-rw-r--r--src/mesa/drivers/dri/r128/r128_context.h5
-rw-r--r--src/mesa/drivers/dri/r128/r128_tris.c7
-rw-r--r--src/mesa/drivers/dri/r128/r128_vb.c24
3 files changed, 6 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_context.h b/src/mesa/drivers/dri/r128/r128_context.h
index 3a908d7a1b3..fba6077b29e 100644
--- a/src/mesa/drivers/dri/r128/r128_context.h
+++ b/src/mesa/drivers/dri/r128/r128_context.h
@@ -123,11 +123,6 @@ struct r128_context {
GLuint dirty; /* Hardware state to be updated */
r128_context_regs_t setup;
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
GLuint NewGLState;
GLuint Fallback;
GLuint SetupIndex;
diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c
index a94edb53a44..b00ea62e28d 100644
--- a/src/mesa/drivers/dri/r128/r128_tris.c
+++ b/src/mesa/drivers/dri/r128/r128_tris.c
@@ -231,7 +231,7 @@ static struct {
#define VERT_Y(_v) _v->v.y
#define VERT_Z(_v) _v->v.z
#define AREA_IS_CCW( a ) (a > 0)
-#define GET_VERTEX(e) (rmesa->verts + (e<<rmesa->vertex_stride_shift))
+#define GET_VERTEX(e) (rmesa->verts + (e * rmesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
@@ -436,7 +436,7 @@ r128_fallback_point( r128ContextPtr rmesa,
/* Render unclipped begin/end objects */
/**********************************************************************/
-#define VERT(x) (r128Vertex *)(r128verts + (x << shift))
+#define VERT(x) (r128Vertex *)(r128verts + (x * vertsize * sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
r128_draw_point( rmesa, VERT(start) )
@@ -453,7 +453,7 @@ r128_fallback_point( r128ContextPtr rmesa,
#undef LOCAL_VARS
#define LOCAL_VARS \
r128ContextPtr rmesa = R128_CONTEXT(ctx); \
- const GLuint shift = rmesa->vertex_stride_shift; \
+ const GLuint vertsize = rmesa->vertex_size; \
const char *r128verts = (char *)rmesa->verts; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
(void) elt;
@@ -503,7 +503,6 @@ static void r128FastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
GLuint vertsize = rmesa->vertex_size;
GLuint *vb = r128AllocDmaLow( rmesa, (n-2) * 3 * 4 * vertsize );
GLubyte *r128verts = (GLubyte *)rmesa->verts;
- const GLuint shift = rmesa->vertex_stride_shift;
const GLuint *start = (const GLuint *)VERT(elts[0]);
int i,j;
diff --git a/src/mesa/drivers/dri/r128/r128_vb.c b/src/mesa/drivers/dri/r128/r128_vb.c
index 6c52975286f..e09bedacea2 100644
--- a/src/mesa/drivers/dri/r128/r128_vb.c
+++ b/src/mesa/drivers/dri/r128/r128_vb.c
@@ -64,7 +64,6 @@ static struct {
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[R128_MAX_SETUP];
@@ -108,10 +107,8 @@ static struct {
#define GET_TEXSOURCE(n) rmesa->tmu_source[n]
#define GET_VERTEX_FORMAT() rmesa->vertex_format
#define GET_VERTEX_STORE() rmesa->verts
-#define GET_VERTEX_STRIDE_SHIFT() rmesa->vertex_stride_shift
+#define GET_VERTEX_SIZE() rmesa->vertex_size * sizeof(GLuint)
#define INVALIDATE_STORED_VERTICES()
-#define GET_UBYTE_COLOR_STORE() &rmesa->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &rmesa->UbyteSecondaryColor
#define HAVE_HW_VIEWPORT 0
#define HAVE_HW_DIVIDE 0
@@ -131,9 +128,6 @@ static struct {
#define PTEX_FALLBACK() FALLBACK(R128_CONTEXT(ctx), R128_FALLBACK_TEXTURE, 1)
-#define IMPORT_FLOAT_COLORS r128_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS r128_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[rmesa->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[rmesa->SetupIndex].copy_pv
@@ -373,8 +367,8 @@ void r128BuildVertices( GLcontext *ctx,
GLuint newinputs )
{
r128ContextPtr rmesa = R128_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)rmesa->verts + (start<<rmesa->vertex_stride_shift));
- GLuint stride = 1<<rmesa->vertex_stride_shift;
+ GLuint stride = rmesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)rmesa->verts + (start * stride));
newinputs |= rmesa->SetupNewInputs;
rmesa->SetupNewInputs = 0;
@@ -446,7 +440,6 @@ void r128ChooseVertexState( GLcontext *ctx )
FLUSH_BATCH(rmesa);
rmesa->vertex_format = setup_tab[ind].vertex_format;
rmesa->vertex_size = setup_tab[ind].vertex_size;
- rmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
}
@@ -511,15 +504,4 @@ void r128FreeVB( GLcontext *ctx )
ALIGN_FREE(rmesa->verts);
rmesa->verts = 0;
}
-
-
- if (rmesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(rmesa->UbyteSecondaryColor.Ptr);
- rmesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (rmesa->UbyteColor.Ptr) {
- ALIGN_FREE(rmesa->UbyteColor.Ptr);
- rmesa->UbyteColor.Ptr = 0;
- }
}