summaryrefslogtreecommitdiff
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/glide/fxdd.c7
-rw-r--r--src/mesa/drivers/glide/fxdrv.h2
-rw-r--r--src/mesa/drivers/glide/fxtris.c63
-rw-r--r--src/mesa/drivers/glide/fxvb.c66
-rw-r--r--src/mesa/drivers/glide/fxvbtmp.h2
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c5
-rw-r--r--src/mesa/drivers/x11/xm_line.c38
-rw-r--r--src/mesa/drivers/x11/xm_tri.c78
8 files changed, 165 insertions, 96 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 306e0be3b9..b36cbee47c 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -651,8 +651,7 @@ static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name)
}
static const struct gl_pipeline_stage *fx_pipeline[] = {
- &_tnl_update_material_stage,
- /* TODO: Add the fastpath here */
+ &_tnl_update_material_stage, /* TODO: Add the fastpath here */
&_tnl_vertex_transform_stage,
&_tnl_normal_transform_stage,
&_tnl_lighting_stage,
@@ -660,8 +659,7 @@ static const struct gl_pipeline_stage *fx_pipeline[] = {
&_tnl_texgen_stage,
&_tnl_texture_transform_stage,
&_tnl_point_attenuation_stage,
- &fx_render_stage, /* ADD: render simple unclipped vb's */
- &_tnl_render_stage, /* KEEP: the old render stage for fallbacks */
+ &_tnl_render_stage,
0,
};
@@ -680,7 +678,6 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa )
if (firsttime) {
fxDDSetupInit();
fxDDTrifuncInit();
-/* fxDDFastPathInit(); */
firsttime = 0;
}
diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h
index 38ce0ce2da..cefd6d0e1a 100644
--- a/src/mesa/drivers/glide/fxdrv.h
+++ b/src/mesa/drivers/glide/fxdrv.h
@@ -509,7 +509,7 @@ struct tfxMesaContext {
GLuint size;
};
-typedef void (*tfxSetupFunc)(GLcontext *ctx, GLuint, GLuint, GLuint);
+typedef void (*tfxSetupFunc)(GLcontext *ctx, GLuint, GLuint );
extern GrHwConfiguration glbHWConfig;
extern int glbCurrentBoard;
diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c
index 7d887133b6..11072a2601 100644
--- a/src/mesa/drivers/glide/fxtris.c
+++ b/src/mesa/drivers/glide/fxtris.c
@@ -11,6 +11,7 @@
#include "swrast_setup/swrast_setup.h"
#include "tnl/t_context.h"
+#include "tnl/t_pipeline.h"
#include "fxdrv.h"
#include "fxglidew.h"
@@ -469,6 +470,56 @@ fx_null_tri( GLcontext *ctx,
+
+/**********************************************************************/
+/* Render whole begin/end objects */
+/**********************************************************************/
+
+
+/* Vertices, no clipping.
+ */
+#define RENDER_POINTS( start, count ) \
+ for ( ; start < count ; start++) \
+ grDrawPoint( &v[ELT(start)].v );
+
+#define RENDER_LINE( i1, i ) \
+ grDrawLine( &v[i1].v, &v[i].v )
+
+#define RENDER_TRI( i2, i1, i ) \
+ grDrawTriangle( &v[i2].v, &v[i1].v, &v[i].v )
+
+#define RENDER_QUAD( i3, i2, i1, i ) \
+ grDrawTriangle( &v[i3].v, &v[i2].v, &v[i].v ); \
+ grDrawTriangle( &v[i2].v, &v[i1].v, &v[i].v )
+
+#define TAG(x) fx_##x##_verts
+#define LOCAL_VARS \
+ fxVertex *v = FX_CONTEXT(ctx)->verts;
+
+/* Verts, no clipping.
+ */
+#define ELT(x) x
+#define RESET_STIPPLE
+#define RESET_OCCLUSION
+#define PRESERVE_VB_DEFS
+#include "tnl/t_vb_rendertmp.h"
+
+
+/* Elts, no clipping.
+ */
+#undef ELT
+#undef TAG
+#undef LOCAL_VARS
+#define TAG(x) fx_##x##_elts
+#define ELT(x) elt[x]
+#define LOCAL_VARS \
+ fxVertex *v = FX_CONTEXT(ctx)->verts; \
+ const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts;
+#include "tnl/t_vb_rendertmp.h"
+
+
+
+
/* Setup the Point, Line, Triangle and Quad functions based on the
* current rendering state. Wherever possible, use the hardware to
* render the primitive. Otherwise, fallback to software rendering.
@@ -487,6 +538,8 @@ void fxDDChooseRenderState( GLcontext *ctx )
ctx->Driver.LineFunc = _swsetup_Line;
ctx->Driver.TriangleFunc = _swsetup_Triangle;
ctx->Driver.QuadFunc = _swsetup_Quad;
+ ctx->Driver.RenderTabVerts = _tnl_render_tab_verts;
+ ctx->Driver.RenderTabElts = _tnl_render_tab_elts;
fxMesa->render_index = FX_FALLBACK_BIT;
return;
@@ -549,9 +602,19 @@ void fxDDChooseRenderState( GLcontext *ctx )
ctx->Driver.TriangleFunc = rast_tab[index].triangle;
ctx->Driver.QuadFunc = rast_tab[index].quad;
fxMesa->render_index = index;
+
+ if (fxMesa->render_index == 0) {
+ ctx->Driver.RenderTabVerts = fx_render_tab_verts;
+ ctx->Driver.RenderTabElts = fx_render_tab_elts;
+ } else {
+ ctx->Driver.RenderTabVerts = _tnl_render_tab_verts;
+ ctx->Driver.RenderTabElts = _tnl_render_tab_elts;
+ }
}
+
+
#else
diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c
index 22128e61f6..3138d59649 100644
--- a/src/mesa/drivers/glide/fxvb.c
+++ b/src/mesa/drivers/glide/fxvb.c
@@ -238,10 +238,10 @@ static tfxSetupFunc setupfuncs[MAX_SETUP];
static void
-fxsetup_invalid( GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs )
+fxsetup_invalid( GLcontext *ctx, GLuint start, GLuint end )
{
fprintf(stderr, "fxMesa: invalid setup function\n");
- (void) (ctx && start && end && newinputs);
+ (void) (ctx && start && end);
}
@@ -334,43 +334,49 @@ void fx_BuildProjVerts( GLcontext *ctx, GLuint start, GLuint count,
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb;
- GLuint ind = fxMesa->setup_gone;
- fxMesa->setup_gone = 0;
+ if (newinputs == ~0) {
+ /* build interpolated vertices */
+ setupfuncs[fxMesa->setupindex]( ctx, start, count );
+ } else {
+ GLuint ind = fxMesa->setup_gone;
+ fxMesa->setup_gone = 0;
- if (newinputs & VERT_CLIP)
- ind = fxMesa->setupindex; /* clipmask has changed - invalidated all */
- else {
- if (newinputs & VERT_TEX0)
- ind |= fxMesa->tex_dest[0];
+ if (newinputs & VERT_CLIP)
+ ind = fxMesa->setupindex; /* clipmask has potentially changed */
+ else {
+ if (newinputs & VERT_TEX0)
+ ind |= fxMesa->tex_dest[0];
- if (newinputs & VERT_TEX1)
- ind |= fxMesa->tex_dest[1];
-
- if (newinputs & VERT_RGBA)
- ind |= SETUP_RGBA;
-
- ind &= fxMesa->setupindex;
- }
+ if (newinputs & VERT_TEX1)
+ ind |= fxMesa->tex_dest[1];
- if (0) {
- _tnl_print_vert_flags("newinputs", newinputs);
- fxPrintSetupFlags("setup function", ind);
- }
+ if (newinputs & VERT_RGBA)
+ ind |= SETUP_RGBA;
- if (fxMesa->new_state)
- fxSetupFXUnits( ctx );
+ ind &= fxMesa->setupindex;
+ }
- if (VB->importable_data)
- VB->import_data( ctx, VB->importable_data & newinputs,
- (VB->ClipOrMask
- ? VEC_NOT_WRITEABLE|VEC_BAD_STRIDE
- : VEC_BAD_STRIDE));
+ if (0) {
+ _tnl_print_vert_flags("newinputs", newinputs);
+ fxPrintSetupFlags("setup function", ind);
+ }
- setupfuncs[ind]( ctx, start, count, newinputs );
+ if (ind) {
+ if (fxMesa->new_state)
+ fxSetupFXUnits( ctx );
+
+ if (VB->importable_data)
+ VB->import_data( ctx, VB->importable_data & newinputs,
+ (VB->ClipOrMask
+ ? VEC_NOT_WRITEABLE|VEC_BAD_STRIDE
+ : VEC_BAD_STRIDE));
+
+ setupfuncs[ind]( ctx, start, count );
+ }
+ }
}
-
void fxAllocVB( GLcontext *ctx )
{
fxMesaContext fxMesa = FX_CONTEXT(ctx);
diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h
index af21fc40af..0133758295 100644
--- a/src/mesa/drivers/glide/fxvbtmp.h
+++ b/src/mesa/drivers/glide/fxvbtmp.h
@@ -27,7 +27,7 @@
*/
-static void NAME(GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs)
+static void NAME(GLcontext *ctx, GLuint start, GLuint end )
{
fxMesaContext fxMesa = (fxMesaContext)ctx->DriverCtx;
fxVertex *verts = fxMesa->verts;
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 6148100e22..f26ed3867e 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.36 2001/01/02 22:02:52 brianp Exp $ */
+/* $Id: osmesa.c,v 1.37 2001/01/05 02:26:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -55,6 +55,7 @@
#include "swrast/s_lines.h"
#include "swrast/s_triangle.h"
#include "tnl/tnl.h"
+#include "array_cache/acache.h"
#endif
@@ -313,6 +314,7 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
GLcontext *ctx = &osmesa->gl_ctx;
_swrast_CreateContext( ctx );
+ _ac_CreateContext( ctx );
_tnl_CreateContext( ctx );
_swsetup_CreateContext( ctx );
@@ -1752,5 +1754,6 @@ static void osmesa_update_state( GLcontext *ctx, GLuint new_state )
_swrast_InvalidateState( ctx, new_state );
_swsetup_InvalidateState( ctx, new_state );
+ _ac_InvalidateState( ctx, new_state );
_tnl_InvalidateState( ctx, new_state );
}
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index c76de401c8..e9bbfbca41 100644
--- a/src/mesa/drivers/x11/xm_line.c
+++ b/src/mesa/drivers/x11/xm_line.c
@@ -1,4 +1,4 @@
-/* $Id: xm_line.c,v 1.14 2001/01/02 22:02:52 brianp Exp $ */
+/* $Id: xm_line.c,v 1.15 2001/01/05 02:26:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -127,7 +127,7 @@ static void flat_TRUECOLOR_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
XMesaImage *img = xmesa->xm_buffer->backimage;
unsigned long pixel;
PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
@@ -148,7 +148,7 @@ static void flat_8A8B8G8R_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
#define PIXEL_TYPE GLuint
@@ -168,7 +168,7 @@ static void flat_8R8G8B_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
#define PIXEL_TYPE GLuint
@@ -188,7 +188,7 @@ static void flat_8R8G8B24_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -211,7 +211,7 @@ static void flat_5R6G5B_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
#define PIXEL_TYPE GLushort
@@ -231,7 +231,7 @@ static void flat_DITHER_5R6G5B_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -251,7 +251,7 @@ static void flat_DITHER8_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLint r = color[0], g = color[1], b = color[2];
DITHER_SETUP;
@@ -273,7 +273,7 @@ static void flat_LOOKUP8_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLubyte pixel;
LOOKUP_SETUP;
pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
@@ -295,7 +295,7 @@ static void flat_HPCR_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLint r = color[0], g = color[1], b = color[2];
#define INTERP_XY 1
@@ -317,7 +317,7 @@ static void flat_TRUECOLOR_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
XMesaImage *img = xmesa->xm_buffer->backimage;
unsigned long pixel;
PACK_TRUECOLOR( pixel, color[0], color[1], color[2] );
@@ -343,7 +343,7 @@ static void flat_8A8B8G8R_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLuint pixel = PACK_8B8G8R( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -369,7 +369,7 @@ static void flat_8R8G8B_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLuint pixel = PACK_8R8G8B( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -395,7 +395,7 @@ static void flat_8R8G8B24_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
@@ -422,7 +422,7 @@ static void flat_5R6G5B_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLushort pixel = PACK_5R6G5B( color[0], color[1], color[2] );
#define INTERP_Z 1
@@ -447,7 +447,7 @@ static void flat_DITHER_5R6G5B_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
@@ -471,7 +471,7 @@ static void flat_DITHER8_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLint r = color[0], g = color[1], b = color[2];
DITHER_SETUP;
@@ -498,7 +498,7 @@ static void flat_LOOKUP8_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLubyte pixel;
LOOKUP_SETUP;
pixel = (GLubyte) LOOKUP( color[0], color[1], color[2] );
@@ -526,7 +526,7 @@ static void flat_HPCR_z_line( GLcontext *ctx,
const SWvertex *vert0, const SWvertex *vert1 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = vert0->color;
+ const GLubyte *color = vert1->color;
GLint r = color[0], g = color[1], b = color[2];
#define INTERP_XY 1
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index dbd252c50c..12f1f49a48 100644
--- a/src/mesa/drivers/x11/xm_tri.c
+++ b/src/mesa/drivers/x11/xm_tri.c
@@ -1,4 +1,4 @@
-/* $Id: xm_tri.c,v 1.15 2001/01/02 22:02:52 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.16 2001/01/05 02:26:48 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -451,7 +451,7 @@ static void flat_TRUECOLOR_z_triangle( GLcontext *ctx,
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
unsigned long pixel; \
- PACK_TRUECOLOR(pixel, v0->color[0], v0->color[1], v0->color[2]);
+ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -485,8 +485,8 @@ static void flat_8A8B8G8R_z_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_8B8G8R( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_8B8G8R( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
@@ -519,8 +519,8 @@ static void flat_8R8G8B_z_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_8R8G8B( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
@@ -547,7 +547,7 @@ static void flat_8R8G8B24_z_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v0->color;
+ const GLubyte *color = v2->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
@@ -593,8 +593,8 @@ static void flat_TRUEDITHER_z_triangle( GLcontext *ctx,
GLdepth z = FixedToDepth(ffz); \
if (z < zRow[i]) { \
unsigned long p; \
- PACK_TRUEDITHER( p, xx, yy, v0->color[0], \
- v0->color[1], v0->color[2] ); \
+ PACK_TRUEDITHER( p, xx, yy, v2->color[0], \
+ v2->color[1], v2->color[2] ); \
XMesaPutPixel( img, xx, yy, p ); \
zRow[i] = z; \
} \
@@ -620,8 +620,8 @@ static void flat_5R6G5B_z_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_5R6G5B( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_5R6G5B( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, len = RIGHT-LEFT; \
@@ -648,7 +648,7 @@ static void flat_DITHER_5R6G5B_z_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v0->color;
+ const GLubyte *color = v2->color;
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
@@ -688,7 +688,7 @@ static void flat_DITHER8_z_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- FLAT_DITHER_SETUP( v0->color[0], v0->color[1], v0->color[2] );
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -721,7 +721,7 @@ static void flat_DITHER_z_triangle( GLcontext *ctx,
#define INTERP_Z 1
#define DEPTH_TYPE DEFAULT_SOFTWARE_DEPTH_TYPE
#define SETUP_CODE \
- FLAT_DITHER_SETUP( v0->color[0], v0->color[1], v0->color[2] );
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -757,9 +757,9 @@ static void flat_HPCR_z_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- GLubyte r = v0->color[0]; \
- GLubyte g = v0->color[1]; \
- GLubyte b = v0->color[2];
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2];
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint i, xx = LEFT, yy = FLIP(xmesa->xm_buffer,Y), len = RIGHT-LEFT; \
@@ -793,9 +793,9 @@ static void flat_LOOKUP8_z_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
LOOKUP_SETUP; \
- GLubyte r = v0->color[0]; \
- GLubyte g = v0->color[1]; \
- GLubyte b = v0->color[2]; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
GLubyte p = LOOKUP(r,g,b);
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -1128,7 +1128,7 @@ static void flat_TRUECOLOR_triangle( GLcontext *ctx,
XMesaImage *img = xmesa->xm_buffer->backimage;
#define SETUP_CODE \
unsigned long pixel; \
- PACK_TRUECOLOR(pixel, v0->color[0], v0->color[1], v0->color[2]);
+ PACK_TRUECOLOR(pixel, v2->color[0], v2->color[1], v2->color[2]);
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -1154,8 +1154,8 @@ static void flat_8A8B8G8R_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_8B8G8R( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_8B8G8R( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint xx; \
@@ -1181,8 +1181,8 @@ static void flat_8R8G8B_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLuint
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_8R8G8B( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_8R8G8B( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint xx; \
@@ -1204,7 +1204,7 @@ static void flat_8R8G8B24_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v0->color;
+ const GLubyte *color = v2->color;
#define PIXEL_ADDRESS(X,Y) PIXELADDR3(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE bgr_t
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -1237,8 +1237,8 @@ static void flat_TRUEDITHER_triangle( GLcontext *ctx,
GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
for (xx=LEFT;xx<RIGHT;xx++) { \
unsigned long p; \
- PACK_TRUEDITHER( p, xx, yy, v0->color[0], \
- v0->color[1], v0->color[2] ); \
+ PACK_TRUEDITHER( p, xx, yy, v2->color[0], \
+ v2->color[1], v2->color[2] ); \
XMesaPutPixel( img, xx, yy, p ); \
} \
}
@@ -1260,8 +1260,8 @@ static void flat_5R6G5B_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- unsigned long p = PACK_5R6G5B( v0->color[0], \
- v0->color[1], v0->color[2] );
+ unsigned long p = PACK_5R6G5B( v2->color[0], \
+ v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint xx; \
@@ -1283,7 +1283,7 @@ static void flat_DITHER_5R6G5B_triangle( GLcontext *ctx,
const SWvertex *v2 )
{
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
- const GLubyte *color = v0->color;
+ const GLubyte *color = v2->color;
#define PIXEL_ADDRESS(X,Y) PIXELADDR2(xmesa->xm_buffer,X,Y)
#define PIXEL_TYPE GLushort
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
@@ -1313,7 +1313,7 @@ static void flat_DITHER8_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- FLAT_DITHER_SETUP( v0->color[0], v0->color[1], v0->color[2] );
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -1339,7 +1339,7 @@ static void flat_DITHER_triangle( GLcontext *ctx,
XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
XMesaImage *img = xmesa->xm_buffer->backimage;
#define SETUP_CODE \
- FLAT_DITHER_SETUP( v0->color[0], v0->color[1], v0->color[2] );
+ FLAT_DITHER_SETUP( v2->color[0], v2->color[1], v2->color[2] );
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
@@ -1367,9 +1367,9 @@ static void flat_HPCR_triangle( GLcontext *ctx,
#define PIXEL_TYPE GLubyte
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
- GLubyte r = v0->color[0]; \
- GLubyte g = v0->color[1]; \
- GLubyte b = v0->color[2];
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2];
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \
GLint xx, yy = FLIP(xmesa->xm_buffer, Y); \
@@ -1396,9 +1396,9 @@ static void flat_LOOKUP8_triangle( GLcontext *ctx,
#define BYTES_PER_ROW (xmesa->xm_buffer->backimage->bytes_per_line)
#define SETUP_CODE \
LOOKUP_SETUP; \
- GLubyte r = v0->color[0]; \
- GLubyte g = v0->color[1]; \
- GLubyte b = v0->color[2]; \
+ GLubyte r = v2->color[0]; \
+ GLubyte g = v2->color[1]; \
+ GLubyte b = v2->color[2]; \
GLubyte p = LOOKUP(r,g,b);
#define INNER_LOOP( LEFT, RIGHT, Y ) \
{ \