GLINTSAREADRIPtr sarea;
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
/* Mirrors of some DRI state
*/
drmContext hHWContext;
#define HAVE_ELTS 0
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- GAMMA_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS;
-}
static const GLuint hw_prim[GL_POLYGON+1] = {
B_PrimType_Points,
#define LOCAL_VARS gammaContextPtr gmesa = GAMMA_CONTEXT(ctx)
#define INIT( prim ) gammaStartPrimitive( gmesa, prim )
-#define FINISH gammaEndPrimitive( gmesa )
-#define NEW_PRIMITIVE() /* GAMMA_STATECHANGE( gmesa, 0 ) */
-#define NEW_BUFFER() /* GAMMA_FIREVERTICES( gmesa ) */
+#define FLUSH() gammaEndPrimitive( gmesa )
#define GET_CURRENT_VB_MAX_VERTS() \
(gmesa->bufSize - gmesa->bufCount) / 2
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
GAMMA_DMA_BUFFER_SIZE / 2
-#define EMIT_VERTS( ctx, j, nr ) gamma_emit(ctx, j, (j)+(nr))
+
+#define ALLOC_VERTS( nr ) (void *)0 /* todo: explicit alloc */
+#define EMIT_VERTS( ctx, j, nr, buf ) (gamma_emit(ctx, j, (j)+(nr)), (void *)0)
#define TAG(x) gamma_##x
#include "tnl_dd/t_dd_dmatmp.h"
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- GLuint i, length, flags = 0;
+ GLuint i;
render_func *tab;
/* GH: THIS IS A HACK!!! */
return GL_TRUE; /* don't handle clipping here */
/* We don't do elts */
- if (VB->Elts)
+ if (VB->Elts || !gamma_validate_render( ctx, VB ))
return GL_TRUE;
tab = TAG(render_tab_verts);
#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) (gmesa->verts + (e<<gmesa->vertex_stride_shift))
+#define GET_VERTEX(e) (gmesa->verts + (e * gmesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/* Render unclipped begin/end objects */
/**********************************************************************/
-#define VERT(x) (gammaVertex *)(gammaverts + (x << shift))
+#define VERT(x) (gammaVertex *)(gammaverts + (x * size * sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
gmesa->draw_point( gmesa, VERT(start) )
#undef LOCAL_VARS
#define LOCAL_VARS \
gammaContextPtr gmesa = GAMMA_CONTEXT(ctx); \
- const GLuint shift = gmesa->vertex_stride_shift; \
+ const GLuint size = gmesa->vertex_size; \
const char *gammaverts = (char *)gmesa->verts; \
const GLboolean stipple = ctx->Line.StippleFlag; \
(void) stipple;
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[GAMMA_MAX_SETUP];
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() GAMMA_CONTEXT(ctx)->vertex_format
#define GET_VERTEX_STORE() GAMMA_CONTEXT(ctx)->verts
-#define GET_VERTEX_STRIDE_SHIFT() GAMMA_CONTEXT(ctx)->vertex_stride_shift
+#define GET_VERTEX_SIZE() GAMMA_CONTEXT(ctx)->vertex_size * sizeof(GLuint)
#define INVALIDATE_STORED_VERTICES()
-#define GET_UBYTE_COLOR_STORE() &GAMMA_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &GAMMA_CONTEXT(ctx)->UbyteSecondaryColor
#define HAVE_HW_VIEWPORT 1
#define HAVE_HW_DIVIDE 1
#define PTEX_FALLBACK() /* never needed */
-#define IMPORT_QUALIFIER
-#define IMPORT_FLOAT_COLORS gamma_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS gamma_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[GAMMA_CONTEXT(ctx)->SetupIndex].copy_pv
GLuint newinputs )
{
gammaContextPtr gmesa = GAMMA_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)gmesa->verts + (start<<gmesa->vertex_stride_shift));
- GLuint stride = 1<<gmesa->vertex_stride_shift;
+ GLuint stride = gmesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)gmesa->verts + (start * stride));
newinputs |= gmesa->SetupNewInputs;
gmesa->SetupNewInputs = 0;
if (setup_tab[ind].vertex_format != gmesa->vertex_format) {
gmesa->vertex_format = setup_tab[ind].vertex_format;
gmesa->vertex_size = setup_tab[ind].vertex_size;
- gmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) {
if (firsttime) {
init_setup_tab();
firsttime = 0;
- gmesa->vertex_stride_shift = 6; /* FIXME - only one vertex setup */
+ gmesa->vertex_size = 16; /* FIXME - only one vertex setup */
}
}
}
ALIGN_FREE(gmesa->verts);
gmesa->verts = 0;
}
-
- if (gmesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(gmesa->UbyteSecondaryColor.Ptr);
- gmesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (gmesa->UbyteColor.Ptr) {
- ALIGN_FREE(gmesa->UbyteColor.Ptr);
- gmesa->UbyteColor.Ptr = 0;
- }
}
*/
GLuint Fallback;
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
/* State for i810vb.c and i810tris.c.
*/
GLuint new_state; /* _NEW_* flags */
GL_TRIANGLES
};
-/* Fallback to normal rendering.
- */
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start,
- count, flags );
- I810_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS;
-}
I810_STATECHANGE(imesa, 0); \
i810RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \
} while (0)
-#define NEW_PRIMITIVE() I810_STATECHANGE( imesa, 0 )
-#define NEW_BUFFER() I810_FIREVERTICES( imesa )
#define GET_CURRENT_VB_MAX_VERTS() \
(((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4))
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
(I810_DMA_BUF_SZ-4) / (imesa->vertex_size * 4)
+#define ALLOC_VERTS( nr ) \
+ i810AllocDmaLow( imesa, nr * imesa->vertex_size * 4)
+#define EMIT_VERTS( ctx, j, nr, buf ) \
+ i810_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
-#define EMIT_VERTS( ctx, j, nr ) \
- i810_emit_contiguous_verts(ctx, j, (j)+(nr))
+#define FLUSH() I810_FIREVERTICES( imesa )
#define TAG(x) i810_##x
/* Don't handle clipping or indexed vertices.
*/
- if (VB->ClipOrMask || imesa->RenderIndex != 0 || VB->Elts) {
+ if (imesa->RenderIndex != 0 ||
+ !i810_validate_render( ctx, VB )) {
return GL_TRUE;
}
#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) (imesa->verts + (e<<imesa->vertex_stride_shift))
+#define GET_VERTEX(e) (imesa->verts + (e * imesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/**********************************************************************/
#define IND 0
-#define V(x) (i810Vertex *)(vertptr + ((x)<<vertshift))
+#define V(x) (i810Vertex *)(vertptr + ((x)*vertsize*sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) POINT( V(ELT(start)) );
#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
#define LOCAL_VARS \
i810ContextPtr imesa = I810_CONTEXT(ctx); \
GLubyte *vertptr = (GLubyte *)imesa->verts; \
- const GLuint vertshift = imesa->vertex_stride_shift; \
+ const GLuint vertsize = imesa->vertex_size; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
(void) elt;
#define RESET_STIPPLE
GLuint vertsize = imesa->vertex_size;
GLuint *vb = i810AllocDmaLow( imesa, (n-2) * 3 * 4 * vertsize );
GLubyte *vertptr = (GLubyte *)imesa->verts;
- const GLuint vertshift = imesa->vertex_stride_shift;
const GLuint *start = (const GLuint *)V(elts[0]);
int i,j;
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[I810_MAX_SETUP];
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() I810_CONTEXT(ctx)->Setup[I810_CTXREG_VF]
#define GET_VERTEX_STORE() I810_CONTEXT(ctx)->verts
-#define GET_VERTEX_STRIDE_SHIFT() I810_CONTEXT(ctx)->vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &I810_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &I810_CONTEXT(ctx)->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() I810_CONTEXT(ctx)->vertex_size * sizeof(GLuint)
#define INVALIDATE_STORED_VERTICES()
#define HAVE_HW_VIEWPORT 0
#define PTEX_FALLBACK() FALLBACK(I810_CONTEXT(ctx), I810_FALLBACK_TEXTURE, 1)
-#define IMPORT_FLOAT_COLORS i810_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS i810_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[I810_CONTEXT(ctx)->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[I810_CONTEXT(ctx)->SetupIndex].copy_pv
GLuint newinputs )
{
i810ContextPtr imesa = I810_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)imesa->verts + (start<<imesa->vertex_stride_shift));
- GLuint stride = 1<<imesa->vertex_stride_shift;
+ GLuint stride = imesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)imesa->verts + (start * stride));
if (0) fprintf(stderr, "%s\n", __FUNCTION__);
I810_STATECHANGE(imesa, I810_UPLOAD_CTX);
imesa->Setup[I810_CTXREG_VF] = setup_tab[ind].vertex_format;
imesa->vertex_size = setup_tab[ind].vertex_size;
- imesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
}
-void i810_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count )
+void *i810_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ void *dest )
{
i810ContextPtr imesa = I810_CONTEXT(ctx);
- GLuint vertex_size = imesa->vertex_size * 4;
- GLuint *dest = i810AllocDmaLow( imesa, (count-start) * vertex_size);
- setup_tab[imesa->SetupIndex].emit( ctx, start, count, dest, vertex_size );
+ GLuint stride = imesa->vertex_size * 4;
+ setup_tab[imesa->SetupIndex].emit( ctx, start, count, dest, stride );
+ return (void *)((char *)dest + stride * (count - start));
}
ALIGN_FREE(imesa->verts);
imesa->verts = 0;
}
-
- if (imesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(imesa->UbyteSecondaryColor.Ptr);
- imesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (imesa->UbyteColor.Ptr) {
- ALIGN_FREE(imesa->UbyteColor.Ptr);
- imesa->UbyteColor.Ptr = 0;
- }
}
GLuint newinputs );
-extern void i810_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
+extern void *i810_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ void *dest );
extern void i810_translate_vertex( GLcontext *ctx,
const i810Vertex *src,
GLuint Fallback;
GLuint NewGLState;
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
/* State for i830vb.c and i830tris.c.
*/
GLuint SetupNewInputs;
3
};
-/* Fallback to normal rendering. Should now never be called.
- */
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start,
- count, flags );
- I830_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS;
-}
-
#define LOCAL_VARS i830ContextPtr imesa = I830_CONTEXT(ctx)
#define INIT( prim ) do { \
i830RasterPrimitive( ctx, reduced_prim[prim], hw_prim[prim] ); \
} while (0)
-#define NEW_PRIMITIVE() I830_STATECHANGE( imesa, 0 )
-#define NEW_BUFFER() I830_FIREVERTICES( imesa )
+#define FLUSH() I830_FIREVERTICES( imesa )
#define GET_CURRENT_VB_MAX_VERTS() \
(((int)imesa->vertex_high - (int)imesa->vertex_low) / (imesa->vertex_size*4))
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
(I830_DMA_BUF_SZ-8) / (imesa->vertex_size * 4)
-#define EMIT_VERTS( ctx, j, nr ) \
- i830_emit_contiguous_verts(ctx, j, (j)+(nr))
+
+#define ALLOC_VERTS( nr ) \
+ i830AllocDmaLow( imesa, nr * imesa->vertex_size * 4)
+#define EMIT_VERTS( ctx, j, nr, buf ) \
+ i830_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
#define TAG(x) i830_##x
#include "tnl_dd/t_dd_dmatmp.h"
for (i = 0 ; i < VB->PrimitiveCount ; i++)
{
GLuint prim = VB->Primitive[i].mode;
- GLuint start = VB->Primitive[i].start;
GLuint length = VB->Primitive[i].count;
if (!length)
i830ContextPtr imesa = I830_CONTEXT(ctx);
TNLcontext *tnl = TNL_CONTEXT(ctx);
struct vertex_buffer *VB = &tnl->vb;
- GLuint i, length, flags = 0;
+ GLuint i;
/* Don't handle clipping or indexed vertices.
*/
- if (VB->ClipOrMask || imesa->RenderIndex != 0 || VB->Elts ||
+ if (imesa->RenderIndex != 0 ||
+ !i830_validate_render( ctx, VB ) ||
!choose_render( VB, GET_SUBSEQUENT_VB_MAX_VERTS() )) {
return GL_TRUE;
}
#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) (imesa->verts + (e<<imesa->vertex_stride_shift))
+#define GET_VERTEX(e) (imesa->verts + (e * imesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/**********************************************************************/
#define IND 0
-#define V(x) (i830Vertex *)(vertptr + ((x)<<vertshift))
+#define V(x) (i830Vertex *)(vertptr + ((x) * vertsize * sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) POINT( V(ELT(start)) );
#define RENDER_LINE( v0, v1 ) LINE( V(v0), V(v1) )
#define LOCAL_VARS \
i830ContextPtr imesa = I830_CONTEXT(ctx); \
GLubyte *vertptr = (GLubyte *)imesa->verts; \
- const GLuint vertshift = imesa->vertex_stride_shift; \
+ const GLuint vertsize = imesa->vertex_size; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
(void) elt;
#define RESET_STIPPLE
GLuint vertsize = imesa->vertex_size;
GLuint *vb = i830AllocDmaLow( imesa, (n-2) * 3 * 4 * vertsize );
GLubyte *vertptr = (GLubyte *)imesa->verts;
- const GLuint vertshift = imesa->vertex_stride_shift;
const GLuint *start = (const GLuint *)V(elts[0]);
int i,j;
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[I830_MAX_SETUP];
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() I830_CONTEXT(ctx)->vertex_format
#define GET_VERTEX_STORE() ((GLubyte *)I830_CONTEXT(ctx)->verts)
-#define GET_VERTEX_STRIDE_SHIFT() I830_CONTEXT(ctx)->vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &I830_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &I830_CONTEXT(ctx)->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() I830_CONTEXT(ctx)->vertex_size * sizeof(int)
#define INVALIDATE_STORED_VERTICES()
#define HAVE_HW_VIEWPORT 0
#define PTEX_FALLBACK() FALLBACK(I830_CONTEXT(ctx), I830_FALLBACK_TEXTURE, 1)
-#define IMPORT_FLOAT_COLORS i830_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS i830_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[I830_CONTEXT(ctx)->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[I830_CONTEXT(ctx)->SetupIndex].copy_pv
}
imesa->vertex_format = vfmt;
imesa->vertex_size = setup_tab[ind].vertex_size;
- imesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
if (!imesa->Fallback &&
GLuint newinputs )
{
i830ContextPtr imesa = I830_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)
- imesa->verts + (start<<imesa->vertex_stride_shift));
- GLuint stride = 1<<imesa->vertex_stride_shift;
+ GLuint stride = imesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *) imesa->verts + (start * stride));
if (0) fprintf(stderr, "%s\n", __FUNCTION__);
}
imesa->vertex_format = vfmt;
imesa->vertex_size = setup_tab[ind].vertex_size;
- imesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
}
-void i830_emit_contiguous_verts( GLcontext *ctx,
+void *i830_emit_contiguous_verts( GLcontext *ctx,
GLuint start,
- GLuint count )
+ GLuint count,
+ void *dest)
{
i830ContextPtr imesa = I830_CONTEXT(ctx);
- GLuint vertex_size = imesa->vertex_size * 4;
- GLuint *dest = i830AllocDmaLow( imesa, (count-start) * vertex_size);
- setup_tab[imesa->SetupIndex].emit( ctx, start, count, dest, vertex_size );
+ GLuint stride = imesa->vertex_size * 4;
+ setup_tab[imesa->SetupIndex].emit( ctx, start, count, dest, stride );
+ return (void *)((char *)dest + stride * (count - start));
}
ALIGN_FREE(imesa->verts);
imesa->verts = 0;
}
-
- if (imesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(imesa->UbyteSecondaryColor.Ptr);
- imesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (imesa->UbyteColor.Ptr) {
- ALIGN_FREE(imesa->UbyteColor.Ptr);
- imesa->UbyteColor.Ptr = 0;
- }
}
GLuint newinputs );
-extern void i830_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
+extern void *i830_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ void *dest );
extern void i830_translate_vertex( GLcontext *ctx,
const i830Vertex *src,
*/
GLuint Fallback;
-
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
/* Texture environment color.
*/
unsigned int envcolor[2];
mgaRasterPrimitive( ctx, GL_TRIANGLES, hwprim );
}
-static void VERT_FALLBACK( GLcontext *ctx, GLuint start, GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- MGA_CONTEXT(ctx)->SetupNewInputs |= VERT_BIT_POS;
-}
#define LOCAL_VARS mgaContextPtr mmesa = MGA_CONTEXT(ctx)
#define INIT( prim ) do { \
FLUSH_BATCH(mmesa); \
mgaDmaPrimitive( ctx, prim ); \
} while (0)
-#define NEW_PRIMITIVE() FLUSH_BATCH( mmesa )
-#define NEW_BUFFER() FLUSH_BATCH( mmesa )
+#define FLUSH() FLUSH_BATCH( mmesa )
#define GET_CURRENT_VB_MAX_VERTS() \
0 /* fix me */
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
MGA_BUFFER_SIZE / (mmesa->vertex_size * 4)
-#define EMIT_VERTS( ctx, j, nr ) \
- mga_emit_contiguous_verts(ctx, j, (j)+(nr))
+
+
+#define ALLOC_VERTS( nr ) \
+ mgaAllocDmaLow( mmesa, nr * mmesa->vertex_size * 4)
+#define EMIT_VERTS( ctx, j, nr, buf ) \
+ mga_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
#define TAG(x) mga_##x
/* Don't handle clipping or indexed vertices or vertex manipulations.
*/
- if (VB->ClipOrMask || mmesa->RenderIndex != 0 || VB->Elts) {
+ if (mmesa->RenderIndex != 0 ||
+ !mga_validate_render( ctx, VB )) {
return GL_TRUE;
}
#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) (mmesa->verts + (e<<mmesa->vertex_stride_shift))
+#define GET_VERTEX(e) (mmesa->verts + (e * mmesa->vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/**********************************************************************/
-#define VERT(x) (mgaVertex *)(vertptr + ((x)<<vertshift))
+#define VERT(x) (mgaVertex *)(vertptr + ((x)*vertex_size*sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
mga_draw_point( mmesa, VERT(ELT(start)) );
#define LOCAL_VARS \
mgaContextPtr mmesa = MGA_CONTEXT(ctx); \
GLubyte *vertptr = (GLubyte *)mmesa->verts; \
- const GLuint vertshift = mmesa->vertex_stride_shift; \
+ const GLuint vertex_size = mmesa->vertex_size; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
(void) elt;
#define RESET_STIPPLE
GLuint vertex_size = mmesa->vertex_size;
GLuint *vb = mgaAllocDmaLow( mmesa, (n-2) * 3 * 4 * vertex_size );
GLubyte *vertptr = (GLubyte *)mmesa->verts;
- const GLuint vertshift = mmesa->vertex_stride_shift;
const GLuint *start = (const GLuint *)VERT(elts[0]);
int i,j;
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[MGA_MAX_SETUP];
#define GET_TEXSOURCE(n) mmesa->tmu_source[n]
#define GET_VERTEX_FORMAT() mmesa->vertex_format
#define GET_VERTEX_STORE() mmesa->verts
-#define GET_VERTEX_STRIDE_SHIFT() mmesa->vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &mmesa->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &mmesa->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() mmesa->vertex_size * sizeof(GLuint)
#define HAVE_HW_VIEWPORT 0
#define HAVE_HW_DIVIDE 0
#define PTEX_FALLBACK() FALLBACK(ctx, MGA_FALLBACK_TEXTURE, 1)
-
-#define IMPORT_FLOAT_COLORS mga_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS mga_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[MGA_CONTEXT(ctx)->SetupIndex].copy_pv
GLuint newinputs )
{
mgaContextPtr mmesa = MGA_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)mmesa->verts + (start<<mmesa->vertex_stride_shift));
- GLuint stride = 1<<mmesa->vertex_stride_shift;
+ GLuint stride = mmesa->vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)mmesa->verts + (start * stride));
newinputs |= mmesa->SetupNewInputs;
mmesa->SetupNewInputs = 0;
mmesa->dirty |= MGA_UPLOAD_PIPE;
mmesa->vertex_format = setup_tab[ind].vertex_format;
mmesa->vertex_size = setup_tab[ind].vertex_size;
- mmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
}
-void mga_emit_contiguous_verts( GLcontext *ctx,
+void *mga_emit_contiguous_verts( GLcontext *ctx,
GLuint start,
- GLuint count )
+ GLuint count,
+ void *dest)
{
mgaContextPtr mmesa = MGA_CONTEXT(ctx);
- GLuint vertex_size = mmesa->vertex_size * 4;
- GLuint *dest = mgaAllocDmaLow( mmesa, (count-start) * vertex_size);
- setup_tab[mmesa->SetupIndex].emit( ctx, start, count, dest, vertex_size );
+ GLuint stride = mmesa->vertex_size * 4;
+ setup_tab[mmesa->SetupIndex].emit( ctx, start, count, dest, stride );
+ return (void *)((char *)dest + stride * (count - start));
}
mmesa->dirty |= MGA_UPLOAD_PIPE;
mmesa->vertex_format = setup_tab[0].vertex_format;
mmesa->vertex_size = setup_tab[0].vertex_size;
- mmesa->vertex_stride_shift = setup_tab[0].vertex_stride_shift;
}
ALIGN_FREE(mmesa->verts);
mmesa->verts = 0;
}
-
- if (mmesa->UbyteSecondaryColor.Ptr) {
- ALIGN_FREE(mmesa->UbyteSecondaryColor.Ptr);
- mmesa->UbyteSecondaryColor.Ptr = 0;
- }
-
- if (mmesa->UbyteColor.Ptr) {
- ALIGN_FREE(mmesa->UbyteColor.Ptr);
- mmesa->UbyteColor.Ptr = 0;
- }
}
extern void mgaInitVB( GLcontext *ctx );
extern void mgaFreeVB( GLcontext *ctx );
-extern void mga_emit_contiguous_verts( GLcontext *ctx,
+extern void *mga_emit_contiguous_verts( GLcontext *ctx,
GLuint start,
- GLuint count );
+ GLuint count,
+ void *dest );
extern void mga_translate_vertex(GLcontext *ctx,
const mgaVertex *src,
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;
#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 { \
/* 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) )
#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;
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;
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];
#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
#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
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;
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;
}
}
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;
- }
}
fprintf(stderr, "disabling 3D acceleration\n");
FALLBACK(rmesa, R200_FALLBACK_DISABLE, 1);
}
- else if (tcl_mode == DRI_CONF_TCL_SW) {
+ else if (tcl_mode == DRI_CONF_TCL_SW || getenv("R200_NO_TCL")) {
fprintf(stderr, "disabling TCL support\n");
TCL_FALLBACK(rmesa->glCtx, R200_TCL_FALLBACK_TCL_DISABLE, 1);
}
else {
- if (tcl_mode >= DRI_CONF_TCL_VTXFMT) {
+ if (tcl_mode >= DRI_CONF_TCL_VTXFMT && !getenv("R200_NO_VTXFMT")) {
r200VtxfmtInit( ctx, tcl_mode >= DRI_CONF_TCL_CODEGEN );
}
_tnl_need_dlist_norm_lengths( ctx, GL_FALSE );
(r200ContextPtr) driContextPriv->driverPrivate;
if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, newCtx->glCtx);
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)newCtx->glCtx);
if ( newCtx->dri.drawable != driDrawPriv ) {
driDrawableInitVBlank( driDrawPriv, newCtx->vblank_flags );
r200ContextPtr rmesa = (r200ContextPtr) driContextPriv->driverPrivate;
if (R200_DEBUG & DEBUG_DRI)
- fprintf(stderr, "%s ctx %p\n", __FUNCTION__, rmesa->glCtx);
+ fprintf(stderr, "%s ctx %p\n", __FUNCTION__, (void *)rmesa->glCtx);
r200VtxfmtUnbindContext( rmesa->glCtx );
return GL_TRUE;
GLuint Fallback;
GLuint NewGLState;
-
- /* Temporaries for translating away float colors:
- */
- struct gl_client_array UbyteColor;
- struct gl_client_array UbyteSecondaryColor;
-
/* Vertex buffers
*/
struct r200_ioctl ioctl;
rmesa = (r200ContextPtr) dPriv->driContextPriv->driverPrivate;
if ( R200_DEBUG & DEBUG_IOCTL ) {
- fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, rmesa->glCtx );
+ fprintf( stderr, "\n%s( %p )\n\n", __FUNCTION__, (void *)rmesa->glCtx );
}
R200_FIREVERTICES( rmesa );
#include "r200_swtcl.h"
#include "r200_maos.h"
+
+#if 0
/* Usage:
* - from r200_tcl_render
* - call r200EmitArrays to ensure uptodate arrays in dma
}
}
-
-#if defined(USE_X86_ASM)
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int __tmp; \
- __asm__ __volatile__( "rep ; movsl" \
- : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
- : "0" (nr), \
- "D" ((long)dst), \
- "S" ((long)src) ); \
-} while (0)
-#else
-#define COPY_DWORDS( dst, src, nr ) \
-do { \
- int j; \
- for ( j = 0 ; j < nr ; j++ ) \
- dst[j] = ((int *)src)[j]; \
- dst += nr; \
-} while (0)
-#endif
-
-
-
static void emit_ubyte_rgba4( GLcontext *ctx,
struct r200_dma_region *rvb,
char *data,
}
-#if 0
static void emit_ubyte_rgba( GLcontext *ctx,
struct r200_dma_region *rvb,
char *data,
#endif
+#if defined(USE_X86_ASM)
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int __tmp; \
+ __asm__ __volatile__( "rep ; movsl" \
+ : "=%c" (__tmp), "=D" (dst), "=S" (__tmp) \
+ : "0" (nr), \
+ "D" ((long)dst), \
+ "S" ((long)src) ); \
+} while (0)
+#else
+#define COPY_DWORDS( dst, src, nr ) \
+do { \
+ int j; \
+ for ( j = 0 ; j < nr ; j++ ) \
+ dst[j] = ((int *)src)[j]; \
+ dst += nr; \
+} while (0)
+#endif
+
+
+
+
+
static void emit_vec4( GLcontext *ctx,
struct r200_dma_region *rvb,
char *data,
if (R200_DEBUG & DEBUG_VERTS)
fprintf(stderr, "%s count %d stride %d out %p data %p\n",
- __FUNCTION__, count, stride, out, (void *)data);
+ __FUNCTION__, count, stride, (void *)out, (void *)data);
if (stride == 12)
COPY_DWORDS( out, data, count*3 );
#define DO_TEX3 0
#define GET_TEXSOURCE(n) n
-#define GET_UBYTE_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteSecondaryColor
-
-#define IMPORT_FLOAT_COLORS r200_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS r200_import_float_spec_colors
/***********************************************************************
* Generate vertex emit functions *
#include "tnl/tnl.h"
#include "tnl/t_context.h"
#include "tnl/t_pipeline.h"
+#include "tnl/t_vtx_api.h"
#include "r200_context.h"
#include "r200_ioctl.h"
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[R200_MAX_SETUP];
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() R200_CONTEXT(ctx)->swtcl.vertex_format
#define GET_VERTEX_STORE() R200_CONTEXT(ctx)->swtcl.verts
-#define GET_VERTEX_STRIDE_SHIFT() R200_CONTEXT(ctx)->swtcl.vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &R200_CONTEXT(ctx)->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() R200_CONTEXT(ctx)->swtcl.vertex_size * sizeof(GLuint)
#define HAVE_HW_VIEWPORT 1
#define HAVE_HW_DIVIDE (IND & ~(R200_XYZW_BIT|R200_RGBA_BIT))
#define CHECK_HW_DIVIDE (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE| \
DD_TRI_UNFILLED)))
-#define IMPORT_QUALIFIER
-#define IMPORT_FLOAT_COLORS r200_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS r200_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[R200_CONTEXT(ctx)->swtcl.SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[R200_CONTEXT(ctx)->swtcl.SetupIndex].copy_pv
R200_NEWPRIM(rmesa);
i = rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
- rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
R200_STATECHANGE( rmesa, vtx );
rmesa->hw.vtx.cmd[VTX_VTXFMT_0] = se_vtx_fmt_0[i];
GLuint newinputs )
{
r200ContextPtr rmesa = R200_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)rmesa->swtcl.verts +
- (start << rmesa->swtcl.vertex_stride_shift));
- GLuint stride = 1 << rmesa->swtcl.vertex_stride_shift;
+ GLuint stride = rmesa->swtcl.vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)rmesa->swtcl.verts + (start * stride));
newinputs |= rmesa->swtcl.SetupNewInputs;
rmesa->swtcl.SetupNewInputs = 0;
-void r200_emit_contiguous_verts( GLcontext *ctx, GLuint start, GLuint count )
+static void *r200_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ void *dest)
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
- GLuint vertex_size = rmesa->swtcl.vertex_size * 4;
- CARD32 *dest = r200AllocDmaLowVerts( rmesa, count-start, vertex_size );
- setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest,
- vertex_size );
+ GLuint stride = rmesa->swtcl.vertex_size * 4;
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest, stride );
+ return (void *)((char *)dest + stride * (count - start));
}
}
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- R200_CONTEXT(ctx)->swtcl.SetupNewInputs = _TNL_BIT_POS;
-}
-
-static void ELT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- R200_CONTEXT(ctx)->swtcl.SetupNewInputs = _TNL_BIT_POS;
-}
#define LOCAL_VARS r200ContextPtr rmesa = R200_CONTEXT(ctx)
-#define ELTS_VARS GLushort *dest
+#define ELTS_VARS(buf) GLushort *dest = buf
#define INIT( prim ) r200DmaPrimitive( rmesa, prim )
#define ELT_INIT(prim) r200EltPrimitive( rmesa, prim )
-#define NEW_PRIMITIVE() R200_NEWPRIM( rmesa )
-#define NEW_BUFFER() r200RefillCurrentDmaRegion( rmesa )
+#define FLUSH() R200_NEWPRIM( rmesa )
#define GET_CURRENT_VB_MAX_VERTS() \
(((int)rmesa->dma.current.end - (int)rmesa->dma.current.ptr) / (rmesa->swtcl.vertex_size*4))
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
#define GET_SUBSEQUENT_VB_MAX_ELTS() \
((R200_CMD_BUF_SZ - 1024) / 2)
+static void *r200_alloc_elts( r200ContextPtr rmesa, int nr )
+{
+ if (rmesa->dma.flush == r200FlushElts &&
+ rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) {
+ rmesa->store.cmd_used += nr*2;
+
+ return (void *)(rmesa->store.cmd_buf + rmesa->store.cmd_used);
+ }
+ else {
+ if (rmesa->dma.flush) {
+ rmesa->dma.flush( rmesa );
+ }
+
+ r200EmitVertexAOS( rmesa,
+ rmesa->swtcl.vertex_size,
+ (rmesa->r200Screen->gart_buffer_offset +
+ rmesa->swtcl.indexed_verts.buf->buf->idx *
+ RADEON_BUFFER_SIZE +
+ rmesa->swtcl.indexed_verts.start));
+
+ return (void *) r200AllocEltsOpenEnded( rmesa,
+ rmesa->swtcl.hw_primitive,
+ nr );
+ }
+}
+
+#define ALLOC_ELTS(nr) r200_alloc_elts(rmesa, nr)
-/* How do you extend an existing primitive?
- */
-#define ALLOC_ELTS(nr) \
-do { \
- if (rmesa->dma.flush == r200FlushElts && \
- rmesa->store.cmd_used + nr*2 < R200_CMD_BUF_SZ) { \
- \
- dest = (GLushort *)(rmesa->store.cmd_buf + \
- rmesa->store.cmd_used); \
- rmesa->store.cmd_used += nr*2; \
- } \
- else { \
- if (rmesa->dma.flush) { \
- rmesa->dma.flush( rmesa ); \
- } \
- \
- r200EmitVertexAOS( rmesa, \
- rmesa->swtcl.vertex_size, \
- (rmesa->r200Screen->gart_buffer_offset + \
- rmesa->swtcl.indexed_verts.buf->buf->idx * \
- RADEON_BUFFER_SIZE + \
- rmesa->swtcl.indexed_verts.start)); \
- \
- dest = r200AllocEltsOpenEnded( rmesa, \
- rmesa->swtcl.hw_primitive, \
- nr ); \
- } \
-} while (0)
-#define ALLOC_ELTS_NEW_PRIMITIVE(nr) ALLOC_ELTS( nr )
#ifdef MESA_BIG_ENDIAN
/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
#endif
#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
#define INCR_ELTS( nr ) dest += nr
+#define ELTPTR dest
#define RELEASE_ELT_VERTS() \
r200ReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ )
-#define EMIT_VERTS( ctx, j, nr ) \
- r200_emit_contiguous_verts(ctx, j, (j)+(nr))
+
#define EMIT_INDEXED_VERTS( ctx, start, count ) \
r200_emit_indexed_verts( ctx, start, count )
+#define ALLOC_VERTS( nr ) \
+ r200AllocDmaLowVerts( rmesa, nr, rmesa->swtcl.vertex_size * 4 )
+#define EMIT_VERTS( ctx, j, nr, buf ) \
+ r200_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
+
+
+
#define TAG(x) r200_dma_##x
#include "tnl_dd/t_dd_dmatmp.h"
/**********************************************************************/
+
static GLboolean r200_run_render( GLcontext *ctx,
struct tnl_pipeline_stage *stage )
{
- if ((R200_DEBUG & DEBUG_VERTS) || /* No debug */
- VB->ClipOrMask || /* No clipping */
- rmesa->swtcl.RenderIndex != 0 || /* No per-vertex manipulations */
- ctx->Line.StippleFlag) /* No stipple -- fix me? */
+ if ((R200_DEBUG & DEBUG_VERTS) ||
+ rmesa->swtcl.RenderIndex != 0 ||
+ !r200_dma_validate_render( ctx, VB ))
return GL_TRUE;
if (VB->Elts) {
tab = TAG(render_tab_elts);
- if (!rmesa->swtcl.indexed_verts.buf)
- if (!TAG(emit_elt_verts)(ctx, 0, VB->Count))
- return GL_TRUE; /* too many vertices */
+ if (!rmesa->swtcl.indexed_verts.buf) {
+ if (VB->Count > GET_SUBSEQUENT_VB_MAX_VERTS())
+ return GL_TRUE;
+ EMIT_INDEXED_VERTS(ctx, 0, VB->Count);
+ }
}
tnl->Driver.Render.Start( ctx );
***********************************************************************/
#undef LOCAL_VARS
+#undef ALLOC_VERTS
#define CTX_ARG r200ContextPtr rmesa
#define CTX_ARG2 rmesa
#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
#define ALLOC_VERTS( n, size ) r200AllocDmaLowVerts( rmesa, n, size * 4 )
#define LOCAL_VARS \
r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
const char *r200verts = (char *)rmesa->swtcl.verts;
-#define VERT(x) (r200Vertex *)(r200verts + (x << shift))
+#define VERT(x) (r200Vertex *)(r200verts + ((x) * vertsize * sizeof(int)))
#define VERTEX r200Vertex
#define DO_DEBUG_VERTS (1 && (R200_DEBUG & DEBUG_VERTS))
#define PRINT_VERTEX(v) r200_print_vertex(rmesa->glCtx, v)
#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->swtcl.verts + (e<<rmesa->swtcl.vertex_stride_shift))
+#define GET_VERTEX(e) (rmesa->swtcl.verts + (e*rmesa->swtcl.vertex_size*sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/* Render unclipped begin/end objects */
/**********************************************************************/
-#define VERT(x) (r200Vertex *)(r200verts + (x << shift))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
r200_point( rmesa, VERT(start) )
#undef LOCAL_VARS
#define LOCAL_VARS \
r200ContextPtr rmesa = R200_CONTEXT(ctx); \
- const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const GLuint vertsize = rmesa->swtcl.vertex_size; \
const char *r200verts = (char *)rmesa->swtcl.verts; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
const GLboolean stipple = ctx->Line.StippleFlag; \
ALIGN_FREE(rmesa->swtcl.verts);
rmesa->swtcl.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;
- }
}
extern void r200PrintSetupFlags(char *msg, GLuint flags );
-extern void r200_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-
extern void r200_emit_indexed_verts( GLcontext *ctx,
GLuint start,
GLuint count );
texObj->DriverData = t;
if ( t != NULL ) {
if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, texObj, t );
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, (void *)texObj,
+ (void *)t );
}
/* Initialize non-image-dependent parts of the state:
struct gl_texture_object *texObj )
{
if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, texObj,
+ fprintf( stderr, "%s( %p ) unit=%d\n", __FUNCTION__, (void *)texObj,
ctx->Texture.CurrentUnit );
}
driTextureObject * t = (driTextureObject *) texObj->DriverData;
if ( R200_DEBUG & (DEBUG_STATE|DEBUG_TEXTURE) ) {
- fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, texObj,
+ fprintf( stderr, "%s( %p (target = %s) )\n", __FUNCTION__, (void *)texObj,
_mesa_lookup_enum_by_nr( texObj->Target ) );
}
r200DestroyTexObj( r200ContextPtr rmesa, r200TexObjPtr t )
{
if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__, t, t->base.tObj );
+ fprintf( stderr, "%s( %p, %p )\n", __FUNCTION__,
+ (void *)t, (void *)t->base.tObj );
}
if ( rmesa != NULL ) {
if ( R200_DEBUG & DEBUG_TEXTURE ) {
fprintf( stderr, "%s( %p, %p ) level/width/height/face = %d/%d/%d/%u\n",
- __FUNCTION__, t, t->base.tObj, level, width, height, face );
+ __FUNCTION__, (void *)t, (void *)t->base.tObj,
+ level, width, height, face );
}
ASSERT(face < 6);
if ( R200_DEBUG & (DEBUG_TEXTURE|DEBUG_IOCTL) ) {
fprintf( stderr, "%s( %p, %p ) sz=%d lvls=%d-%d\n", __FUNCTION__,
- rmesa->glCtx, t->base.tObj, t->base.totalSize,
+ (void *)rmesa->glCtx, (void *)t->base.tObj, t->base.totalSize,
t->base.firstLevel, t->base.lastLevel );
}
|| (texUnit->_Current != NULL) );
if ( R200_DEBUG & DEBUG_TEXTURE ) {
- fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, ctx, unit );
+ fprintf( stderr, "%s( %p, %d )\n", __FUNCTION__, (void *)ctx, unit );
}
/* Set the texture environment state. Isn't this nice and clean?
CHOOSE(Normal3fv, pfv, MASK_NORM, 0,
(const GLfloat *v), (v))
+#if 0
CHOOSE_COLOR(Color4ub, p4ub, 4, MASK_COLOR, 0,
(GLubyte a,GLubyte b, GLubyte c, GLubyte d), (a,b,c,d))
CHOOSE_COLOR(Color4ubv, pubv, 4, MASK_COLOR, 0,
(GLubyte a,GLubyte b, GLubyte c), (a,b,c))
CHOOSE_COLOR(Color3ubv, pubv, 3, MASK_COLOR, 0,
(const GLubyte *v), (v))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, 0,
+ (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
+CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, 0,
+ (const GLubyte *v), (v))
+#endif
CHOOSE_COLOR(Color4f, p4f, 4, MASK_COLOR, 0,
(GLfloat a,GLfloat b, GLfloat c, GLfloat d), (a,b,c,d))
(const GLfloat *v), (v))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubEXT, p3ub, MASK_SPEC, 0,
- (GLubyte a,GLubyte b, GLubyte c), (a,b,c))
-CHOOSE_SECONDARY_COLOR(SecondaryColor3ubvEXT, pubv, MASK_SPEC, 0,
- (const GLubyte *v), (v))
CHOOSE_SECONDARY_COLOR(SecondaryColor3fEXT, p3f, MASK_SPEC, 0,
(GLfloat a,GLfloat b, GLfloat c), (a,b,c))
CHOOSE_SECONDARY_COLOR(SecondaryColor3fvEXT, pfv, MASK_SPEC, 0,
if (inputs & VERT_BIT_COLOR1) {
if (!rmesa->tcl.spec.buf) {
- if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
- radeon_import_float_spec_colors( ctx );
emit_ubyte_rgba( ctx,
&rmesa->tcl.spec,
#define DO_TEX3 0
#define GET_TEXSOURCE(n) n
-#define GET_UBYTE_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteSecondaryColor
-
-#define IMPORT_FLOAT_COLORS radeon_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS radeon_import_float_spec_colors
/***********************************************************************
* Generate vertex emit functions *
copy_pv_func copy_pv;
GLboolean (*check_tex_sizes)( GLcontext *ctx );
GLuint vertex_size;
- GLuint vertex_stride_shift;
GLuint vertex_format;
} setup_tab[RADEON_MAX_SETUP];
#define GET_TEXSOURCE(n) n
#define GET_VERTEX_FORMAT() RADEON_CONTEXT(ctx)->swtcl.vertex_format
#define GET_VERTEX_STORE() RADEON_CONTEXT(ctx)->swtcl.verts
-#define GET_VERTEX_STRIDE_SHIFT() RADEON_CONTEXT(ctx)->swtcl.vertex_stride_shift
-#define GET_UBYTE_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteColor
-#define GET_UBYTE_SPEC_COLOR_STORE() &RADEON_CONTEXT(ctx)->UbyteSecondaryColor
+#define GET_VERTEX_SIZE() RADEON_CONTEXT(ctx)->swtcl.vertex_size * sizeof(GLuint)
#define HAVE_HW_VIEWPORT 1
/* Tiny vertices don't seem to work atm - haven't looked into why.
#define CHECK_HW_DIVIDE (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE| \
DD_TRI_UNFILLED)))
-#define IMPORT_QUALIFIER
-#define IMPORT_FLOAT_COLORS radeon_import_float_colors
-#define IMPORT_FLOAT_SPEC_COLORS radeon_import_float_spec_colors
-
#define INTERP_VERTEX setup_tab[RADEON_CONTEXT(ctx)->swtcl.SetupIndex].interp
#define COPY_PV_VERTEX setup_tab[RADEON_CONTEXT(ctx)->swtcl.SetupIndex].copy_pv
RADEON_NEWPRIM(rmesa);
rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
- rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
if (!(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) {
GLuint newinputs )
{
radeonContextPtr rmesa = RADEON_CONTEXT( ctx );
- GLubyte *v = ((GLubyte *)rmesa->swtcl.verts +
- (start << rmesa->swtcl.vertex_stride_shift));
- GLuint stride = 1 << rmesa->swtcl.vertex_stride_shift;
+ GLuint stride = rmesa->swtcl.vertex_size * sizeof(int);
+ GLubyte *v = ((GLubyte *)rmesa->swtcl.verts + (start * stride));
newinputs |= rmesa->swtcl.SetupNewInputs;
rmesa->swtcl.SetupNewInputs = 0;
RADEON_NEWPRIM(rmesa);
rmesa->swtcl.vertex_format = setup_tab[ind].vertex_format;
rmesa->swtcl.vertex_size = setup_tab[ind].vertex_size;
- rmesa->swtcl.vertex_stride_shift = setup_tab[ind].vertex_stride_shift;
}
{
-void radeon_emit_contiguous_verts( GLcontext *ctx, GLuint start, GLuint count )
+static void *radeon_emit_contiguous_verts( GLcontext *ctx,
+ GLuint start,
+ GLuint count,
+ void *dest)
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint vertex_size = rmesa->swtcl.vertex_size * 4;
- CARD32 *dest = radeonAllocDmaLowVerts( rmesa, count-start, vertex_size );
- setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest,
- vertex_size );
+ GLuint stride = rmesa->swtcl.vertex_size * 4;
+ setup_tab[rmesa->swtcl.SetupIndex].emit( ctx, start, count, dest, stride );
+ return (void *)((char *)dest + stride * (count - start));
}
}
-static void VERT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabVerts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_POS;
-}
-
-static void ELT_FALLBACK( GLcontext *ctx,
- GLuint start,
- GLuint count,
- GLuint flags )
-{
- TNLcontext *tnl = TNL_CONTEXT(ctx);
- tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK );
- tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 );
- tnl->Driver.Render.PrimTabElts[flags&PRIM_MODE_MASK]( ctx, start, count, flags );
- RADEON_CONTEXT(ctx)->swtcl.SetupNewInputs = VERT_BIT_POS;
-}
#define LOCAL_VARS radeonContextPtr rmesa = RADEON_CONTEXT(ctx)
-#define ELTS_VARS GLushort *dest
+#define ELTS_VARS( buf ) GLushort *dest = buf
#define INIT( prim ) radeonDmaPrimitive( rmesa, prim )
#define ELT_INIT(prim) radeonEltPrimitive( rmesa, prim )
-#define NEW_PRIMITIVE() RADEON_NEWPRIM( rmesa )
-#define NEW_BUFFER() radeonRefillCurrentDmaRegion( rmesa )
+#define FLUSH() RADEON_NEWPRIM( rmesa )
#define GET_CURRENT_VB_MAX_VERTS() \
(((int)rmesa->dma.current.end - (int)rmesa->dma.current.ptr) / (rmesa->swtcl.vertex_size*4))
#define GET_SUBSEQUENT_VB_MAX_VERTS() \
((RADEON_CMD_BUF_SZ - 1024) / 2)
+static void *radeon_alloc_elts( radeonContextPtr rmesa, int nr )
+{
+ if (rmesa->dma.flush == radeonFlushElts &&
+ rmesa->store.cmd_used + nr*2 < RADEON_CMD_BUF_SZ) {
-/* How do you extend an existing primitive?
- */
-#define ALLOC_ELTS(nr) \
-do { \
- if (rmesa->dma.flush == radeonFlushElts && \
- rmesa->store.cmd_used + nr*2 < RADEON_CMD_BUF_SZ) { \
- \
- dest = (GLushort *)(rmesa->store.cmd_buf + \
- rmesa->store.cmd_used); \
- rmesa->store.cmd_used += nr*2; \
- } \
- else { \
- if (rmesa->dma.flush) { \
- rmesa->dma.flush( rmesa ); \
- } \
- \
- radeonEmitVertexAOS( rmesa, \
- rmesa->swtcl.vertex_size, \
- (rmesa->radeonScreen->gart_buffer_offset + \
- rmesa->swtcl.indexed_verts.buf->buf->idx * \
- RADEON_BUFFER_SIZE + \
- rmesa->swtcl.indexed_verts.start)); \
- \
- dest = radeonAllocEltsOpenEnded( rmesa, \
- rmesa->swtcl.vertex_format, \
- rmesa->swtcl.hw_primitive, \
- nr ); \
- } \
-} while (0)
+ rmesa->store.cmd_used += nr*2;
+
+ return (void *)(rmesa->store.cmd_buf + rmesa->store.cmd_used);
+ }
+ else {
+ if (rmesa->dma.flush) {
+ rmesa->dma.flush( rmesa );
+ }
-#define ALLOC_ELTS_NEW_PRIMITIVE(nr) ALLOC_ELTS( nr )
+ radeonEmitVertexAOS( rmesa,
+ rmesa->swtcl.vertex_size,
+ (rmesa->radeonScreen->gart_buffer_offset +
+ rmesa->swtcl.indexed_verts.buf->buf->idx *
+ RADEON_BUFFER_SIZE +
+ rmesa->swtcl.indexed_verts.start));
+
+ return (void *) radeonAllocEltsOpenEnded( rmesa,
+ rmesa->swtcl.vertex_format,
+ rmesa->swtcl.hw_primitive,
+ nr );
+ }
+}
+
+#define ALLOC_ELTS(nr) radeon_alloc_elts(rmesa, nr)
#ifdef MESA_BIG_ENDIAN
/* We could do without (most of) this ugliness if dest was always 32 bit word aligned... */
#endif
#define EMIT_TWO_ELTS(offset, x, y) *(GLuint *)(dest+offset) = ((y)<<16)|(x);
#define INCR_ELTS( nr ) dest += nr
+#define ELTPTR dest
#define RELEASE_ELT_VERTS() \
radeonReleaseDmaRegion( rmesa, &rmesa->swtcl.indexed_verts, __FUNCTION__ )
-#define EMIT_VERTS( ctx, j, nr ) \
- radeon_emit_contiguous_verts(ctx, j, (j)+(nr))
#define EMIT_INDEXED_VERTS( ctx, start, count ) \
radeon_emit_indexed_verts( ctx, start, count )
+#define ALLOC_VERTS( nr ) \
+ radeonAllocDmaLowVerts( rmesa, nr, rmesa->swtcl.vertex_size * 4 )
+#define EMIT_VERTS( ctx, j, nr, buf ) \
+ radeon_emit_contiguous_verts(ctx, j, (j)+(nr), buf)
+
#define TAG(x) radeon_dma_##x
#include "tnl_dd/t_dd_dmatmp.h"
if (rmesa->swtcl.indexed_verts.buf && (!VB->Elts || stage->changed_inputs))
RELEASE_ELT_VERTS();
- if (VB->ClipOrMask || /* No clipping */
- rmesa->swtcl.RenderIndex != 0 || /* No per-vertex manipulations */
- ctx->Line.StippleFlag) /* GH: THIS IS A HACK!!! */
+ if (rmesa->swtcl.RenderIndex != 0 ||
+ !radeon_dma_validate_render( ctx, VB ))
return GL_TRUE;
tnl->Driver.Render.Start( ctx );
if (VB->Elts) {
tab = TAG(render_tab_elts);
- if (!rmesa->swtcl.indexed_verts.buf)
- if (!TAG(emit_elt_verts)(ctx, 0, VB->Count))
- return GL_TRUE; /* too many vertices */
+ if (!rmesa->swtcl.indexed_verts.buf) {
+ if (VB->Count > GET_SUBSEQUENT_VB_MAX_VERTS())
+ return GL_TRUE;
+ EMIT_INDEXED_VERTS(ctx, 0, VB->Count);
+ }
}
for (i = 0 ; i < VB->PrimitiveCount ; i++)
continue;
if (RADEON_DEBUG & DEBUG_PRIMS)
- fprintf(stderr, "r200_render.c: prim %s %d..%d\n",
+ fprintf(stderr, "radeon_render.c: prim %s %d..%d\n",
_mesa_lookup_enum_by_nr(prim & PRIM_MODE_MASK),
start, start+length);
***********************************************************************/
#undef LOCAL_VARS
+#undef ALLOC_VERTS
#define CTX_ARG radeonContextPtr rmesa
#define CTX_ARG2 rmesa
#define GET_VERTEX_DWORDS() rmesa->swtcl.vertex_size
#undef LOCAL_VARS
#define LOCAL_VARS \
radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
const char *radeonverts = (char *)rmesa->swtcl.verts;
-#define VERT(x) (radeonVertex *)(radeonverts + (x << shift))
+#define VERT(x) (radeonVertex *)(radeonverts + (x * vertsize * sizeof(int)))
#define VERTEX radeonVertex
#undef TAG
#define TAG(x) radeon_##x
#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->swtcl.verts + (e<<rmesa->swtcl.vertex_stride_shift))
+#define GET_VERTEX(e) (rmesa->swtcl.verts + (e * rmesa->swtcl.vertex_size * sizeof(int)))
#define VERT_SET_RGBA( v, c ) \
do { \
/* Render unclipped begin/end objects */
/**********************************************************************/
-#define VERT(x) (radeonVertex *)(radeonverts + (x << shift))
+#define VERT(x) (radeonVertex *)(radeonverts + (x * vertsize * sizeof(int)))
#define RENDER_POINTS( start, count ) \
for ( ; start < count ; start++) \
radeon_point( rmesa, VERT(start) )
#undef LOCAL_VARS
#define LOCAL_VARS \
radeonContextPtr rmesa = RADEON_CONTEXT(ctx); \
- const GLuint shift = rmesa->swtcl.vertex_stride_shift; \
+ const GLuint vertsize = rmesa->swtcl.vertex_size; \
const char *radeonverts = (char *)rmesa->swtcl.verts; \
const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \
const GLboolean stipple = ctx->Line.StippleFlag; \
extern void radeonPrintSetupFlags(char *msg, GLuint flags );
-extern void radeon_emit_contiguous_verts( GLcontext *ctx,
- GLuint start,
- GLuint count );
-
extern void radeon_emit_indexed_verts( GLcontext *ctx,
GLuint start,
GLuint count );
extern void radeon_print_vertex( GLcontext *ctx, const radeonVertex *v );
-extern void radeon_import_float_colors( GLcontext *ctx );
-extern void radeon_import_float_spec_colors( GLcontext *ctx );
-
-
#endif
/* 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;
#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 { \
/* 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) )
#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;
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;
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];
#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
#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
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;
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;
}
}
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;
- }
}