aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/sis
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/sis
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/sis')
-rw-r--r--src/mesa/drivers/dri/sis/sis_context.h5
-rw-r--r--src/mesa/drivers/dri/sis/sis_tris.c7
-rw-r--r--src/mesa/drivers/dri/sis/sis_vb.c24
3 files changed, 6 insertions, 30 deletions
diff --git a/src/mesa/drivers/dri/sis/sis_context.h b/src/mesa/drivers/dri/sis/sis_context.h
index fb4191a6ef2..49b73c4fa28 100644
--- a/src/mesa/drivers/dri/sis/sis_context.h
+++ b/src/mesa/drivers/dri/sis/sis_context.h
@@ -235,11 +235,6 @@ struct sis_context
/* This must be first in this structure */
GLcontext *glCtx;
- /* 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/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c
index 6c7865f6c4b..e49c49e72d2 100644
--- a/src/mesa/drivers/dri/sis/sis_tris.c
+++ b/src/mesa/drivers/dri/sis/sis_tris.c
@@ -265,7 +265,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) (smesa->verts + (e << smesa->vertex_stride_shift))
+#define GET_VERTEX(e) (smesa->verts + (e * smesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
@@ -483,7 +483,7 @@ sis_fallback_point( sisContextPtr smesa,
/* Render unclipped begin/end objects */
/**********************************************************************/
-#define VERT(x) (sisVertex *)(sisverts + (x << shift))
+#define VERT(x) (sisVertex *)(sisverts + (x * vertsize * sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
smesa->draw_point( smesa, VERT(start) )
@@ -496,7 +496,7 @@ sis_fallback_point( sisContextPtr smesa,
#undef LOCAL_VARS
#define LOCAL_VARS \
sisContextPtr smesa = SIS_CONTEXT(ctx); \
- const GLuint shift = smesa->vertex_stride_shift; \
+ const GLuint vertsize = smesa->vertex_size; \
const char *sisverts = (char *)smesa->verts; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
(void) elt;
@@ -546,7 +546,6 @@ static void sisFastRenderClippedPoly( GLcontext *ctx, const GLuint *elts,
GLuint vertsize = smesa->vertex_size;
GLuint *vb = r128AllocDmaLow( rmesa, (n-2) * 3 * 4 * vertsize );
GLubyte *sisverts = (GLubyte *)smesa->verts;
- const GLuint shift = smesa->vertex_stride_shift;
const GLuint *start = (const GLuint *)VERT(elts[0]);
int i,j;
diff --git a/src/mesa/drivers/dri/sis/sis_vb.c b/src/mesa/drivers/dri/sis/sis_vb.c
index 620c1d6f105..acff4601e96 100644
--- a/src/mesa/drivers/dri/sis/sis_vb.c
+++ b/src/mesa/drivers/dri/sis/sis_vb.c
@@ -59,7 +59,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[SIS_MAX_SETUP];
@@ -90,9 +89,7 @@ static struct {
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() smesa->vertex_format
#define GET_VERTEX_STORE() smesa->verts
-#define GET_VERTEX_STRIDE_SHIFT() smesa->vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &smesa->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &smesa->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() smesa->vertex_size * sizeof(GLuint)
#define HAVE_HW_VIEWPORT 0
#define HAVE_HW_DIVIDE 0
@@ -112,9 +109,6 @@ static struct {
#define PTEX_FALLBACK() FALLBACK(smesa, SIS_FALLBACK_TEXTURE, 1)
-#define IMPORT_FLOAT_COLORS sis_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS sis_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[smesa->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[smesa->SetupIndex].copy_pv
@@ -351,8 +345,8 @@ void sisBuildVertices( GLcontext *ctx,
GLuint newinputs )
{
sisContextPtr smesa = SIS_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)smesa->verts + (start<<smesa->vertex_stride_shift));
- GLuint stride = 1 << smesa->vertex_stride_shift;
+ GLuint stride = smesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)smesa->verts + (start * stride));
newinputs |= smesa->SetupNewInputs;
smesa->SetupNewInputs = 0;
@@ -423,7 +417,6 @@ void sisChooseVertexState( GLcontext *ctx )
if (setup_tab[ind].vertex_format != smesa->vertex_format) {
smesa->vertex_format = setup_tab[ind].vertex_format;
smesa->vertex_size = setup_tab[ind].vertex_size;
- smesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
}
@@ -449,15 +442,4 @@ void sisFreeVB( GLcontext *ctx )
ALIGN_FREE(smesa->verts);
smesa->verts = NULL;
}
-
-
- if (smesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(smesa->UbyteSecondaryColor.Ptr);
- smesa->UbyteSecondaryColor.Ptr = NULL;
- }
-
- if (smesa->UbyteColor.Ptr) {
- ALIGN_FREE(smesa->UbyteColor.Ptr);
- smesa->UbyteColor.Ptr = NULL;
- }
}