summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/common/t_dd_dmatmp.h11
-rw-r--r--src/mesa/drivers/common/t_dd_vbtmp.h27
-rw-r--r--src/mesa/drivers/common/t_dd_vertex.h8
-rw-r--r--src/mesa/drivers/dos/dmesa.c10
-rw-r--r--src/mesa/drivers/ggi/ggimesa.c6
-rw-r--r--src/mesa/drivers/glide/fxapi.c9
-rw-r--r--src/mesa/drivers/glide/fxdd.c10
-rw-r--r--src/mesa/drivers/glide/fxvb.c4
-rw-r--r--src/mesa/drivers/osmesa/osmesa.c11
-rw-r--r--src/mesa/drivers/svga/svgamesa.c11
-rw-r--r--src/mesa/drivers/windows/wmesa.c18
-rw-r--r--src/mesa/drivers/x11/xm_dd.c14
-rw-r--r--src/mesa/drivers/x11/xm_line.c3
-rw-r--r--src/mesa/drivers/x11/xm_tri.c4
14 files changed, 72 insertions, 74 deletions
diff --git a/src/mesa/drivers/common/t_dd_dmatmp.h b/src/mesa/drivers/common/t_dd_dmatmp.h
index d358c3b0105..b8cf91daf10 100644
--- a/src/mesa/drivers/common/t_dd_dmatmp.h
+++ b/src/mesa/drivers/common/t_dd_dmatmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_dd_dmatmp.h,v 1.12 2002/02/13 00:53:20 keithw Exp $ */
+/* $Id: t_dd_dmatmp.h,v 1.13 2002/06/15 02:38:18 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -49,6 +49,7 @@
#define ELTS_VARS
#define ALLOC_ELTS( nr )
#define EMIT_ELT( offset, elt )
+#define EMIT_TWO_ELTS( offset, elt0, elt1 )
#define INCR_ELTS( nr )
#define ELT_INIT(prim)
#define GET_CURRENT_VB_MAX_ELTS() 0
@@ -480,7 +481,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
- for ( i = 0 ; i < quads*2 ; i+=2 ) {
+ for ( i = j-start ; i < j-start+quads*2 ; i+=2 ) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+2), (i+1) );
EMIT_TWO_ELTS( 4, (i+3), (i+2) );
@@ -601,7 +602,7 @@ static void TAG(render_quads_verts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
- for ( i = 0 ; i < quads*4 ; i+=4 ) {
+ for ( i = j-start ; i < j-start+quads*4 ; i+=4 ) {
EMIT_TWO_ELTS( 0, (i+0), (i+1) );
EMIT_TWO_ELTS( 2, (i+3), (i+1) );
EMIT_TWO_ELTS( 4, (i+2), (i+3) );
@@ -996,7 +997,7 @@ static void TAG(render_quad_strip_elts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads*6 );
- for ( i = 0 ; i < quads ; i++, elts += 2 ) {
+ for ( i = j-start ; i < j-start+quads ; i++, elts += 2 ) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[2], elts[1] );
EMIT_TWO_ELTS( 4, elts[3], elts[2] );
@@ -1064,7 +1065,7 @@ static void TAG(render_quads_elts)( GLcontext *ctx,
NEW_PRIMITIVE();
ALLOC_ELTS_NEW_PRIMITIVE( quads * 6 );
- for ( i = 0 ; i < quads ; i++, elts += 4 ) {
+ for ( i = j-start ; i < j-start+quads ; i++, elts += 4 ) {
EMIT_TWO_ELTS( 0, elts[0], elts[1] );
EMIT_TWO_ELTS( 2, elts[3], elts[1] );
EMIT_TWO_ELTS( 4, elts[2], elts[3] );
diff --git a/src/mesa/drivers/common/t_dd_vbtmp.h b/src/mesa/drivers/common/t_dd_vbtmp.h
index 8f7b638daf9..d88318c16b3 100644
--- a/src/mesa/drivers/common/t_dd_vbtmp.h
+++ b/src/mesa/drivers/common/t_dd_vbtmp.h
@@ -1,4 +1,4 @@
-/* $Id: t_dd_vbtmp.h,v 1.17 2002/06/03 16:06:35 brianp Exp $ */
+/* $Id: t_dd_vbtmp.h,v 1.18 2002/06/15 02:38:18 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -189,15 +189,28 @@ static void TAG(emit)( GLcontext *ctx,
}
if (DO_SPEC) {
- if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
- IMPORT_FLOAT_SPEC_COLORS( ctx );
- spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->Ptr;
- spec_stride = VB->SecondaryColorPtr[0]->StrideB;
+ if (VB->SecondaryColorPtr[0]) {
+ if (VB->SecondaryColorPtr[0]->Type != GL_UNSIGNED_BYTE)
+ IMPORT_FLOAT_SPEC_COLORS( ctx );
+ spec = (GLubyte (*)[4])VB->SecondaryColorPtr[0]->Ptr;
+ spec_stride = VB->SecondaryColorPtr[0]->StrideB;
+ } else {
+ GLubyte tmp[4];
+ spec = &tmp;
+ spec_stride = 0;
+ }
}
if (DO_FOG) {
- fog = VB->FogCoordPtr->data;
- fog_stride = VB->FogCoordPtr->stride;
+ if (VB->FogCoordPtr) {
+ fog = VB->FogCoordPtr->data;
+ fog_stride = VB->FogCoordPtr->stride;
+ }
+ else {
+ GLfloat tmp = 0;
+ fog = &tmp;
+ fog_stride = 0;
+ }
}
if (VB->importable_data) {
diff --git a/src/mesa/drivers/common/t_dd_vertex.h b/src/mesa/drivers/common/t_dd_vertex.h
index ba031fc0bb8..f275856c43b 100644
--- a/src/mesa/drivers/common/t_dd_vertex.h
+++ b/src/mesa/drivers/common/t_dd_vertex.h
@@ -1,4 +1,4 @@
-/* $Id: t_dd_vertex.h,v 1.11 2002/06/05 16:48:54 brianp Exp $ */
+/* $Id: t_dd_vertex.h,v 1.12 2002/06/15 02:38:18 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -77,9 +77,3 @@ typedef union {
GLubyte ub4[24][4];
} TAG(Vertex), *TAG(VertexPtr);
-typedef struct {
- GLfloat clip[4];
- GLuint mask;
- GLuint pad; /* alignment */
- TAG(Vertex) v;
-} TAG(TnlVertex), *TAG(TnlVertexPtr);
diff --git a/src/mesa/drivers/dos/dmesa.c b/src/mesa/drivers/dos/dmesa.c
index 5ac7af42a00..d05d436c1e2 100644
--- a/src/mesa/drivers/dos/dmesa.c
+++ b/src/mesa/drivers/dos/dmesa.c
@@ -526,13 +526,11 @@ static void set_read_buffer (GLcontext *ctx, GLframebuffer *buffer,
/*
* Set the destination/draw buffer.
*/
-static GLboolean set_draw_buffer (GLcontext *ctx, GLenum mode)
+static void set_draw_buffer (GLcontext *ctx, GLenum mode)
{
- if (mode==GL_BACK_LEFT) {
- return GL_TRUE;
- } else {
- return GL_FALSE;
- }
+ /*
+ XXX this has to be fixed
+ */
}
diff --git a/src/mesa/drivers/ggi/ggimesa.c b/src/mesa/drivers/ggi/ggimesa.c
index 339a7085908..97ab159558a 100644
--- a/src/mesa/drivers/ggi/ggimesa.c
+++ b/src/mesa/drivers/ggi/ggimesa.c
@@ -144,7 +144,7 @@ static void gl_ggiClear(GLcontext *ctx, GLbitfield mask, GLboolean all,
}
/* Set the buffer used for drawing */
-static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
+static void gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
{
ggi_mesa_context_t ggi_ctx = (ggi_mesa_context_t)ctx->DriverCtx;
@@ -155,17 +155,15 @@ static GLboolean gl_ggiSetDrawBuffer(GLcontext *ctx, GLenum mode)
{
ggiSetWriteFrame(ggi_ctx->ggi_visual,
ggiGetDisplayFrame(ggi_ctx->ggi_visual));
- return GL_TRUE;
}
else if (mode == GL_BACK_LEFT)
{
ggiSetWriteFrame(ggi_ctx->ggi_visual,
ggiGetDisplayFrame(ggi_ctx->ggi_visual)?0 : 1);
- return GL_TRUE;
}
else
{
- return GL_FALSE;
+ /* nothing since we don't have any point/line/triangle functions. */
}
}
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c
index 2aab6b11215..5ba01b66e7c 100644
--- a/src/mesa/drivers/glide/fxapi.c
+++ b/src/mesa/drivers/glide/fxapi.c
@@ -1,4 +1,4 @@
-/* $Id: fxapi.c,v 1.32 2001/09/23 16:50:01 brianp Exp $ */
+/* $Id: fxapi.c,v 1.33 2002/06/15 02:38:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -283,6 +283,7 @@ fxMesaCreateContext(GLuint win,
char *errorstr;
GLboolean useBGR;
char *system = NULL;
+ __GLimports imports;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxMesaCreateContext() Start\n");
@@ -508,8 +509,10 @@ fxMesaCreateContext(GLuint win,
goto errorhandler;
}
- ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, /* share list context */
- (void *) fxMesa, GL_TRUE);
+ _mesa_init_default_imports( &imports, (void *) fxMesa);
+ ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis,
+ shareCtx,
+ &imports);
if (!ctx) {
errorstr = "_mesa_create_context";
goto errorhandler;
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index a5541eceb1d..caff9488512 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -1,4 +1,4 @@
-/* $Id: fxdd.c,v 1.86 2002/06/13 04:28:30 brianp Exp $ */
+/* $Id: fxdd.c,v 1.87 2002/06/15 02:38:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -264,7 +264,7 @@ fxDDClear(GLcontext * ctx, GLbitfield mask, GLboolean all,
/* Set the buffer used for drawing */
/* XXX support for separate read/draw buffers hasn't been tested */
-static GLboolean
+static void
fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode)
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
@@ -276,19 +276,17 @@ fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode)
if (mode == GL_FRONT_LEFT) {
fxMesa->currentFB = GR_BUFFER_FRONTBUFFER;
FX_grRenderBuffer(fxMesa->currentFB);
- return GL_TRUE;
}
else if (mode == GL_BACK_LEFT) {
fxMesa->currentFB = GR_BUFFER_BACKBUFFER;
FX_grRenderBuffer(fxMesa->currentFB);
- return GL_TRUE;
}
else if (mode == GL_NONE) {
FX_grColorMask(FXFALSE, FXFALSE);
- return GL_TRUE;
}
else {
- return GL_FALSE;
+ /* we'll need a software fallback */
+ /* XXX not implemented */
}
}
diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c
index 4983d5f12b4..f0534b65ecc 100644
--- a/src/mesa/drivers/glide/fxvb.c
+++ b/src/mesa/drivers/glide/fxvb.c
@@ -1,4 +1,4 @@
-/* $Id: fxvb.c,v 1.12 2002/06/06 16:19:25 brianp Exp $ */
+/* $Id: fxvb.c,v 1.13 2002/06/15 02:38:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -352,7 +352,7 @@ void fxChooseVertexState( GLcontext *ctx )
ind |= SETUP_TMU0;
}
}
- else if (ctx->Texture._ReallyEnabled & TETURE0_ANY) {
+ else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) {
ind |= SETUP_TMU0;
}
diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c
index 1a5cefea087..4b69df600f3 100644
--- a/src/mesa/drivers/osmesa/osmesa.c
+++ b/src/mesa/drivers/osmesa/osmesa.c
@@ -1,4 +1,4 @@
-/* $Id: osmesa.c,v 1.80 2002/06/13 04:28:30 brianp Exp $ */
+/* $Id: osmesa.c,v 1.81 2002/06/15 02:38:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -707,15 +707,10 @@ do { \
-static GLboolean set_draw_buffer( GLcontext *ctx, GLenum mode )
+static void set_draw_buffer( GLcontext *ctx, GLenum mode )
{
(void) ctx;
- if (mode==GL_FRONT_LEFT) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
+ (void) mode;
}
diff --git a/src/mesa/drivers/svga/svgamesa.c b/src/mesa/drivers/svga/svgamesa.c
index 7e8f81083cf..5d2e3d55a23 100644
--- a/src/mesa/drivers/svga/svgamesa.c
+++ b/src/mesa/drivers/svga/svgamesa.c
@@ -1,4 +1,4 @@
-/* $Id: svgamesa.c,v 1.18 2002/06/13 04:28:30 brianp Exp $ */
+/* $Id: svgamesa.c,v 1.19 2002/06/15 02:38:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -217,7 +217,7 @@ static void get_buffer_size( GLframebuffer *buffer, GLuint *width, GLuint *heigh
*height = SVGAMesa->height = vga_getydim();
}
-static GLboolean set_draw_buffer( GLcontext *ctx, GLenum buffer )
+static void set_draw_buffer( GLcontext *ctx, GLenum buffer )
{
if (buffer == GL_FRONT_LEFT) {
SVGABuffer.DrawBuffer = SVGABuffer.FrontBuffer;
@@ -229,7 +229,6 @@ static GLboolean set_draw_buffer( GLcontext *ctx, GLenum buffer )
SVGABuffer.BackBuffer=SVGABuffer.FrontBuffer;
SVGABuffer.FrontBuffer=tmpptr;
#endif
- return GL_TRUE;
}
else if (buffer == GL_BACK_LEFT) {
SVGABuffer.DrawBuffer = SVGABuffer.BackBuffer;
@@ -237,10 +236,10 @@ static GLboolean set_draw_buffer( GLcontext *ctx, GLenum buffer )
/* vga_waitretrace(); */
copy_buffer(SVGABuffer.BackBuffer);
#endif
- return GL_TRUE;
}
- else
- return GL_FALSE;
+ else {
+ /* nothing since we don't have any point/line/triangle functions. */
+ }
}
diff --git a/src/mesa/drivers/windows/wmesa.c b/src/mesa/drivers/windows/wmesa.c
index b973264cfb6..94a23d2d759 100644
--- a/src/mesa/drivers/windows/wmesa.c
+++ b/src/mesa/drivers/windows/wmesa.c
@@ -1,4 +1,4 @@
-/* $Id: wmesa.c,v 1.29 2002/06/13 04:28:30 brianp Exp $ */
+/* $Id: wmesa.c,v 1.30 2002/06/15 02:38:17 brianp Exp $ */
/*
* Windows (Win32) device driver for Mesa 3.4
@@ -569,15 +569,13 @@ static void enable( GLcontext* ctx, GLenum pname, GLboolean enable )
}
}
-static GLboolean set_draw_buffer( GLcontext* ctx, GLenum mode )
+static void set_draw_buffer( GLcontext* ctx, GLenum mode )
{
- /* TODO: this could be better */
- if (mode==GL_FRONT_LEFT || mode==GL_BACK_LEFT) {
- return GL_TRUE;
- }
- else {
- return GL_FALSE;
- }
+ /* XXX doing nothing for now */
+ /* if front buffer, fine */
+ /* if back buffer, fine */
+ /* else, check swrast->_RasterMask & MULTI_DRAW_BIT, if true, */
+ /* use a swrast fallback function */
}
@@ -3205,6 +3203,8 @@ static triangle_func choose_triangle_function( GLcontext *ctx )
if (ctx->Polygon.SmoothFlag) return NULL;
if (ctx->Texture._ReallyEnabled) return NULL;
if (!wmesa->db_flag) return NULL;
+ if (ctx->swrast->_RasterMask & MULTI_DRAW_BIT) return NULL;
+
/*if (wmesa->xm_buffer->buffer==XIMAGE)*/ {
if ( ctx->Light.ShadeModel==GL_SMOOTH
&& ctx->_RasterMask==DEPTH_BIT
diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c
index 1fdb716cba6..56e63f3252e 100644
--- a/src/mesa/drivers/x11/xm_dd.c
+++ b/src/mesa/drivers/x11/xm_dd.c
@@ -1,8 +1,8 @@
-/* $Id: xm_dd.c,v 1.31 2002/03/19 16:48:06 brianp Exp $ */
+/* $Id: xm_dd.c,v 1.32 2002/06/15 02:38:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 4.0.2
+ * Version: 4.0.3
*
* Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
@@ -115,9 +115,7 @@ flush( GLcontext *ctx )
}
-
-
-static GLboolean
+static void
set_draw_buffer( GLcontext *ctx, GLenum mode )
{
const XMesaContext xmesa = (XMesaContext) ctx->DriverCtx;
@@ -125,7 +123,6 @@ set_draw_buffer( GLcontext *ctx, GLenum mode )
/* write to front buffer */
xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
xmesa_update_span_funcs(ctx);
- return GL_TRUE;
}
else if (mode==GL_BACK_LEFT && xmesa->xm_buffer->db_state) {
/* write to back buffer */
@@ -141,10 +138,11 @@ set_draw_buffer( GLcontext *ctx, GLenum mode )
xmesa->xm_buffer->buffer = xmesa->xm_buffer->frontbuffer;
}
xmesa_update_span_funcs(ctx);
- return GL_TRUE;
}
else {
- return GL_FALSE;
+ /* the swrast->_RasterMask MULTI_DRAW_BIT will be set and
+ * we'll fall back to swrast to draw points/lines/triangles.
+ */
}
}
diff --git a/src/mesa/drivers/x11/xm_line.c b/src/mesa/drivers/x11/xm_line.c
index 30e45b698aa..ce70680901a 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.18 2001/09/12 03:32:29 brianp Exp $ */
+/* $Id: xm_line.c,v 1.19 2002/06/15 02:38:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -560,6 +560,7 @@ static swrast_line_func get_line_func( GLcontext *ctx )
if (ctx->Texture._ReallyEnabled) return (swrast_line_func) NULL;
if (ctx->Light.ShadeModel != GL_FLAT) return (swrast_line_func) NULL;
if (ctx->Line.StippleFlag) return (swrast_line_func) NULL;
+ if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_line_func) NULL;
if (xmesa->xm_buffer->buffer==XIMAGE
&& swrast->_RasterMask==DEPTH_BIT
diff --git a/src/mesa/drivers/x11/xm_tri.c b/src/mesa/drivers/x11/xm_tri.c
index 6a8b678d7b5..f0aef4c0ec6 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.22 2002/04/19 14:05:51 brianp Exp $ */
+/* $Id: xm_tri.c,v 1.23 2002/06/15 02:38:17 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1505,7 +1505,6 @@ static const char *triFuncName = NULL;
#define USE(triFunc) \
do { \
triFuncName = #triFunc; \
- /*printf("%s\n", triFuncName);*/ \
return triFunc; \
} while (0)
@@ -1531,6 +1530,7 @@ static swrast_tri_func get_triangle_func( GLcontext *ctx )
if (ctx->RenderMode != GL_RENDER) return (swrast_tri_func) NULL;
if (ctx->Polygon.SmoothFlag) return (swrast_tri_func) NULL;
if (ctx->Texture._ReallyEnabled) return (swrast_tri_func) NULL;
+ if (swrast->_RasterMask & MULTI_DRAW_BIT) return (swrast_tri_func) NULL;
if (xmesa->xm_buffer->buffer==XIMAGE) {
if ( ctx->Light.ShadeModel==GL_SMOOTH