Added _mesa_printf() Updated SetDrawBuffer() function in all drivers (ala 4.0.3) Import 4.0.3/DRI changes.tags/mesa_4_1
| @@ -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] ); | |||
| @@ -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) { | |||
| @@ -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); | |||
| @@ -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 | |||
| */ | |||
| } | |||
| @@ -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. */ | |||
| } | |||
| } | |||
| @@ -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; | |||
| @@ -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 */ | |||
| } | |||
| } | |||
| @@ -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; | |||
| } | |||
| @@ -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; | |||
| } | |||
| @@ -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. */ | |||
| } | |||
| } | |||
| @@ -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 | |||
| @@ -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. | |||
| */ | |||
| } | |||
| } | |||
| @@ -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 | |||
| @@ -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 | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: api_arrayelt.c,v 1.8 2002/04/19 00:23:08 brianp Exp $ */ | |||
| /* $Id: api_arrayelt.c,v 1.9 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -347,7 +347,7 @@ void _ae_loopback_array_elt( GLint elt ) | |||
| _ae_update_state( ctx ); | |||
| for (ta = actx->texarrays ; ta->func ; ta++) { | |||
| ta->func( ta->unit, (char *)ta->array->Ptr + elt * ta->array->StrideB ); | |||
| ta->func( ta->unit + GL_TEXTURE0_ARB, (char *)ta->array->Ptr + elt * ta->array->StrideB ); | |||
| } | |||
| /* Must be last | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: attrib.c,v 1.66 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: attrib.c,v 1.67 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -120,7 +120,7 @@ _mesa_PushAttrib(GLbitfield mask) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glPushAttrib %x\n", (int) mask); | |||
| _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask); | |||
| if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) { | |||
| _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" ); | |||
| @@ -802,7 +802,8 @@ _mesa_PopAttrib(void) | |||
| while (attr) { | |||
| if (MESA_VERBOSE & VERBOSE_API) { | |||
| _mesa_debug("glPopAttrib %s\n", _mesa_lookup_enum_by_nr(attr->kind)); | |||
| _mesa_debug(ctx, "glPopAttrib %s\n", | |||
| _mesa_lookup_enum_by_nr(attr->kind)); | |||
| } | |||
| switch (attr->kind) { | |||
| @@ -1078,7 +1079,7 @@ _mesa_PopAttrib(void) | |||
| _mesa_set_enable(ctx, GL_CLIP_PLANE0 + i, GL_FALSE); | |||
| } | |||
| if (ctx->Driver.ClipPlane) | |||
| ctx->Driver.ClipPlane( ctx, i, eyePlane ); | |||
| ctx->Driver.ClipPlane( ctx, GL_CLIP_PLANE0 + i, eyePlane ); | |||
| } | |||
| /* normalize/rescale */ | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: blend.c,v 1.35 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: blend.c,v 1.36 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -46,9 +46,9 @@ _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glBlendFunc %s %s\n", | |||
| _mesa_lookup_enum_by_nr(sfactor), | |||
| _mesa_lookup_enum_by_nr(dfactor)); | |||
| _mesa_debug(ctx, "glBlendFunc %s %s\n", | |||
| _mesa_lookup_enum_by_nr(sfactor), | |||
| _mesa_lookup_enum_by_nr(dfactor)); | |||
| switch (sfactor) { | |||
| case GL_SRC_COLOR: | |||
| @@ -127,11 +127,11 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glBlendFuncSeparate %s %s %s %s\n", | |||
| _mesa_lookup_enum_by_nr(sfactorRGB), | |||
| _mesa_lookup_enum_by_nr(dfactorRGB), | |||
| _mesa_lookup_enum_by_nr(sfactorA), | |||
| _mesa_lookup_enum_by_nr(dfactorA)); | |||
| _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n", | |||
| _mesa_lookup_enum_by_nr(sfactorRGB), | |||
| _mesa_lookup_enum_by_nr(dfactorRGB), | |||
| _mesa_lookup_enum_by_nr(sfactorA), | |||
| _mesa_lookup_enum_by_nr(dfactorA)); | |||
| switch (sfactorRGB) { | |||
| case GL_SRC_COLOR: | |||
| @@ -268,8 +268,8 @@ _mesa_BlendEquation( GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glBlendEquation %s\n", | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glBlendEquation %s\n", | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| switch (mode) { | |||
| case GL_FUNC_ADD_EXT: | |||
| @@ -445,7 +445,7 @@ _mesa_ColorMask( GLboolean red, GLboolean green, | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glColorMask %d %d %d %d\n", red, green, blue, alpha); | |||
| _mesa_debug(ctx, "glColorMask %d %d %d %d\n", red, green, blue, alpha); | |||
| /* Shouldn't have any information about channel depth in core mesa | |||
| * -- should probably store these as the native booleans: | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: buffers.c,v 1.35 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: buffers.c,v 1.36 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -97,7 +97,7 @@ _mesa_Clear( GLbitfield mask ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glClear 0x%x\n", mask); | |||
| _mesa_debug(ctx, "glClear 0x%x\n", mask); | |||
| if (mask & ~(GL_COLOR_BUFFER_BIT | | |||
| GL_DEPTH_BUFFER_BIT | | |||
| @@ -146,7 +146,7 @@ _mesa_DrawBuffer( GLenum mode ) | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glDrawBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| switch (mode) { | |||
| case GL_AUX0: | |||
| @@ -267,23 +267,11 @@ _mesa_DrawBuffer( GLenum mode ) | |||
| } | |||
| /* | |||
| * If we get here there can't have been an error. | |||
| * Now see if device driver can implement the drawing to the target | |||
| * buffer(s). The driver may not be able to do GL_FRONT_AND_BACK mode | |||
| * for example. We'll take care of that in the core code by looping | |||
| * over the individual buffers. | |||
| * If we get here there can't have been an error. Now tell the | |||
| * device driver about it. | |||
| */ | |||
| ASSERT(ctx->Driver.SetDrawBuffer); | |||
| if ( (*ctx->Driver.SetDrawBuffer)(ctx, ctx->Color.DriverDrawBuffer) ) { | |||
| /* All OK, the driver will do all buffer writes */ | |||
| ctx->Color.MultiDrawBuffer = GL_FALSE; | |||
| } | |||
| else { | |||
| /* We'll have to loop over the multiple draw buffer targets */ | |||
| ctx->Color.MultiDrawBuffer = GL_TRUE; | |||
| /* Set drawing buffer to front for now */ | |||
| (void) (*ctx->Driver.SetDrawBuffer)(ctx, GL_FRONT_LEFT); | |||
| } | |||
| (*ctx->Driver.SetDrawBuffer)(ctx, ctx->Color.DriverDrawBuffer); | |||
| ctx->Color.DrawBuffer = mode; | |||
| ctx->NewState |= _NEW_COLOR; | |||
| @@ -298,7 +286,7 @@ _mesa_ReadBuffer( GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glReadBuffer %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| switch (mode) { | |||
| case GL_AUX0: | |||
| @@ -360,7 +348,7 @@ _mesa_ResizeBuffersMESA( void ) | |||
| GLcontext *ctx = _mesa_get_current_context(); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glResizeBuffersMESA\n"); | |||
| _mesa_debug(ctx, "glResizeBuffersMESA\n"); | |||
| if (ctx) { | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx ); | |||
| @@ -416,7 +404,7 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height ) | |||
| } | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glScissor %d %d %d %d\n", x, y, width, height); | |||
| _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height); | |||
| if (x == ctx->Scissor.X && | |||
| y == ctx->Scissor.Y && | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: config.h,v 1.38 2002/05/27 17:04:52 brianp Exp $ */ | |||
| /* $Id: config.h,v 1.39 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -151,7 +151,7 @@ | |||
| /* | |||
| * Bits per accumulation buffer color component: 8, 16 or 32 | |||
| */ | |||
| #define ACCUM_BITS 16 | |||
| #define ACCUM_BITS 32 | |||
| /* | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: context.c,v 1.166 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: context.c,v 1.167 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -232,12 +232,13 @@ __glCoreCreateContext(__GLimports *imports, __GLcontextModes *modes) | |||
| { | |||
| GLcontext *ctx; | |||
| ctx = (GLcontext *) (*imports->calloc)(0, 1, sizeof(GLcontext)); | |||
| ctx = (GLcontext *) (*imports->calloc)(NULL, 1, sizeof(GLcontext)); | |||
| if (ctx == NULL) { | |||
| return NULL; | |||
| } | |||
| ctx->Driver.CurrentExecPrimitive=0; /* XXX why is this here??? */ | |||
| ctx->imports = *imports; | |||
| _mesa_init_default_exports(&(ctx->exports)); | |||
| _mesa_initialize_visual(&ctx->Visual, | |||
| modes->rgbMode, | |||
| @@ -552,7 +553,7 @@ _glthread_DECLARE_STATIC_MUTEX(OneTimeLock); | |||
| * This function just calls all the various one-time-init functions in Mesa. | |||
| */ | |||
| static void | |||
| one_time_init( void ) | |||
| one_time_init( GLcontext *ctx ) | |||
| { | |||
| static GLboolean alreadyCalled = GL_FALSE; | |||
| _glthread_LOCK_MUTEX(OneTimeLock); | |||
| @@ -573,7 +574,7 @@ one_time_init( void ) | |||
| #ifdef USE_SPARC_ASM | |||
| _mesa_init_sparc_glapi_relocs(); | |||
| #endif | |||
| if (getenv("MESA_DEBUG")) { | |||
| if (ctx->imports.getenv(ctx, "MESA_DEBUG")) { | |||
| _glapi_noop_enable_warnings(GL_TRUE); | |||
| } | |||
| else { | |||
| @@ -581,7 +582,7 @@ one_time_init( void ) | |||
| } | |||
| #if defined(DEBUG) && defined(__DATE__) && defined(__TIME__) | |||
| fprintf(stderr, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__); | |||
| fprintf(stderr, "Mesa DEBUG build %s %s\n", __DATE__, __TIME__); | |||
| #endif | |||
| alreadyCalled = GL_TRUE; | |||
| @@ -1456,13 +1457,13 @@ init_attrib_groups( GLcontext *ctx ) | |||
| ctx->OcclusionResultSaved = GL_FALSE; | |||
| /* For debug/development only */ | |||
| ctx->NoRaster = getenv("MESA_NO_RASTER") ? GL_TRUE : GL_FALSE; | |||
| ctx->NoRaster = ctx->imports.getenv(ctx, "MESA_NO_RASTER") ? GL_TRUE : GL_FALSE; | |||
| ctx->FirstTimeCurrent = GL_TRUE; | |||
| /* Dither disable */ | |||
| ctx->NoDither = getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; | |||
| ctx->NoDither = ctx->imports.getenv(ctx, "MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; | |||
| if (ctx->NoDither) { | |||
| if (getenv("MESA_DEBUG")) { | |||
| if (ctx->imports.getenv(ctx, "MESA_DEBUG")) { | |||
| fprintf(stderr, "MESA_NO_DITHER set - dithering disabled\n"); | |||
| } | |||
| ctx->Color.DitherFlag = GL_FALSE; | |||
| @@ -1602,11 +1603,14 @@ _mesa_initialize_context( GLcontext *ctx, | |||
| ASSERT(imports); | |||
| ASSERT(imports->other); /* other points to the device driver's context */ | |||
| /* misc one-time initializations */ | |||
| one_time_init(); | |||
| /* assing imports */ | |||
| ctx->imports = *imports; | |||
| /* initialize the exports (Mesa functions called by the window system) */ | |||
| _mesa_init_default_exports( &(ctx->exports) ); | |||
| _mesa_init_default_exports( &(ctx->exports) ); | |||
| /* misc one-time initializations */ | |||
| one_time_init(ctx); | |||
| #if 0 | |||
| /** | |||
| @@ -1756,11 +1760,11 @@ _mesa_initialize_context( GLcontext *ctx, | |||
| #endif | |||
| if (getenv("MESA_DEBUG")) | |||
| add_debug_flags(getenv("MESA_DEBUG")); | |||
| if (ctx->imports.getenv(ctx, "MESA_DEBUG")) | |||
| add_debug_flags(ctx->imports.getenv(ctx, "MESA_DEBUG")); | |||
| if (getenv("MESA_VERBOSE")) | |||
| add_debug_flags(getenv("MESA_VERBOSE")); | |||
| if (ctx->imports.getenv(ctx, "MESA_VERBOSE")) | |||
| add_debug_flags(ctx->imports.getenv(ctx, "MESA_VERBOSE")); | |||
| return GL_TRUE; | |||
| } | |||
| @@ -1779,16 +1783,23 @@ _mesa_create_context( const GLvisual *visual, | |||
| GLcontext *share_list, | |||
| const __GLimports *imports ) | |||
| { | |||
| GLcontext *ctx = (GLcontext *) CALLOC( sizeof(GLcontext) ); | |||
| if (!ctx) { | |||
| GLcontext *ctx; | |||
| ASSERT(visual); | |||
| ASSERT(imports); | |||
| ASSERT(imports->calloc); | |||
| ctx = (GLcontext *) imports->calloc(NULL, 1, sizeof(GLcontext)); | |||
| if (!ctx) | |||
| return NULL; | |||
| } | |||
| ctx->Driver.CurrentExecPrimitive = 0; /* XXX why is this here??? */ | |||
| if (_mesa_initialize_context(ctx, visual, share_list, imports)) { | |||
| return ctx; | |||
| } | |||
| else { | |||
| FREE(ctx); | |||
| imports->free(NULL, ctx); | |||
| return NULL; | |||
| } | |||
| } | |||
| @@ -2054,7 +2065,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, | |||
| GLframebuffer *readBuffer ) | |||
| { | |||
| if (MESA_VERBOSE) | |||
| fprintf(stderr, "_mesa_make_current2()\n"); | |||
| _mesa_debug(newCtx, "_mesa_make_current2()\n"); | |||
| /* Check that the context's and framebuffer's visuals are compatible. | |||
| * We could do a lot more checking here but this'll catch obvious | |||
| @@ -2102,7 +2113,7 @@ _mesa_make_current2( GLcontext *newCtx, GLframebuffer *drawBuffer, | |||
| * information. | |||
| */ | |||
| if (newCtx->FirstTimeCurrent) { | |||
| if (getenv("MESA_INFO")) { | |||
| if (newCtx->imports.getenv(newCtx, "MESA_INFO")) { | |||
| print_info(); | |||
| } | |||
| newCtx->FirstTimeCurrent = GL_FALSE; | |||
| @@ -2162,13 +2173,23 @@ _mesa_get_dispatch(GLcontext *ctx) | |||
| */ | |||
| void _mesa_problem( const GLcontext *ctx, const char *s ) | |||
| { | |||
| fprintf( stderr, "Mesa implementation error: %s\n", s ); | |||
| if (ctx) { | |||
| ctx->imports.fprintf((GLcontext *) ctx, stderr, "Mesa implementation error: %s\n", s); | |||
| #ifdef XF86DRI | |||
| ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the DRI bug database at dri.sourceforge.net\n"); | |||
| #else | |||
| ctx->imports.fprintf((GLcontext *) ctx, stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); | |||
| #endif | |||
| } | |||
| else { | |||
| /* what can we do if we don't have a context???? */ | |||
| fprintf( stderr, "Mesa implementation error: %s\n", s ); | |||
| #ifdef XF86DRI | |||
| fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n"); | |||
| fprintf( stderr, "Please report to the DRI bug database at dri.sourceforge.net\n"); | |||
| #else | |||
| fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); | |||
| fprintf( stderr, "Please report to the Mesa bug database at www.mesa3d.org\n" ); | |||
| #endif | |||
| (void) ctx; | |||
| } | |||
| } | |||
| @@ -2198,9 +2219,15 @@ _mesa_warning( const GLcontext *ctx, const char *s ) | |||
| void | |||
| _mesa_error( GLcontext *ctx, GLenum error, const char *where ) | |||
| { | |||
| const char *debugEnv = getenv("MESA_DEBUG"); | |||
| const char *debugEnv; | |||
| GLboolean debug; | |||
| if (ctx) | |||
| debugEnv = ctx->imports.getenv(ctx, "MESA_DEBUG"); | |||
| else | |||
| /* what can we do??? */ | |||
| debugEnv = ""; | |||
| #ifdef DEBUG | |||
| if (debugEnv && strstr(debugEnv, "silent")) | |||
| debug = GL_FALSE; | |||
| @@ -2262,20 +2289,32 @@ _mesa_error( GLcontext *ctx, GLenum error, const char *where ) | |||
| /* | |||
| * Call this to report debug information. | |||
| * Call this to report debug information. Uses stderr. | |||
| */ | |||
| void | |||
| _mesa_debug( const char *fmtString, ... ) | |||
| _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ) | |||
| { | |||
| #ifdef DEBUG | |||
| va_list args; | |||
| va_start( args, fmtString ); | |||
| (void) vfprintf( stderr, fmtString, args ); | |||
| (void) ctx->imports.fprintf( (__GLcontext *) ctx, stderr, fmtString, args ); | |||
| va_end( args ); | |||
| } | |||
| /* | |||
| * A wrapper for printf. Uses stdout. | |||
| */ | |||
| void | |||
| _mesa_printf( const GLcontext *ctx, const char *fmtString, ... ) | |||
| { | |||
| va_list args; | |||
| va_start( args, fmtString ); | |||
| (void) ctx->imports.fprintf( (__GLcontext *) ctx, stdout, fmtString, args ); | |||
| va_end( args ); | |||
| #endif | |||
| } | |||
| void | |||
| _mesa_Finish( void ) | |||
| { | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: context.h,v 1.31 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: context.h,v 1.32 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -238,7 +238,10 @@ extern void | |||
| _mesa_error( GLcontext *ctx, GLenum error, const char *s ); | |||
| extern void | |||
| _mesa_debug( const char *fmtString, ... ); | |||
| _mesa_debug( const GLcontext *ctx, const char *fmtString, ... ); | |||
| extern void | |||
| _mesa_printf( const GLcontext *ctx, const char *fmtString, ... ); | |||
| @@ -1,10 +1,10 @@ | |||
| /* $Id: dd.h,v 1.68 2002/04/21 18:49:18 brianp Exp $ */ | |||
| /* $Id: dd.h,v 1.69 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| * Version: 3.5 | |||
| * Version: 4.1 | |||
| * | |||
| * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. | |||
| * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. | |||
| * | |||
| * Permission is hereby granted, free of charge, to any person obtaining a | |||
| * copy of this software and associated documentation files (the "Software"), | |||
| @@ -77,7 +77,7 @@ struct dd_function_table { | |||
| * settings! Software Mesa can do masked clears if the device driver can't. | |||
| */ | |||
| GLboolean (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer ); | |||
| void (*SetDrawBuffer)( GLcontext *ctx, GLenum buffer ); | |||
| /* | |||
| * Specifies the current buffer for writing. | |||
| * The following values must be accepted when applicable: | |||
| @@ -85,16 +85,15 @@ struct dd_function_table { | |||
| * GL_BACK_LEFT - when double buffering | |||
| * GL_FRONT_RIGHT - when using stereo | |||
| * GL_BACK_RIGHT - when using stereo and double buffering | |||
| * The folowing values may optionally be accepted. Return GL_TRUE | |||
| * if accepted, GL_FALSE if not accepted. In practice, only drivers | |||
| * which can write to multiple color buffers at once should accept | |||
| * these values. | |||
| * GL_FRONT - write to front left and front right if it exists | |||
| * GL_BACK - write to back left and back right if it exists | |||
| * GL_LEFT - write to front left and back left if it exists | |||
| * GL_RIGHT - write to right left and back right if they exist | |||
| * GL_FRONT_AND_BACK - write to all four buffers if they exist | |||
| * GL_NONE - disable buffer write in device driver. | |||
| * | |||
| * Note the driver must organize fallbacks (eg with swrast) if it | |||
| * cannot implement the requested mode. | |||
| */ | |||
| void (*GetBufferSize)( GLframebuffer *buffer, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: depth.c,v 1.29 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: depth.c,v 1.30 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -70,7 +70,7 @@ _mesa_DepthFunc( GLenum func ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); | |||
| _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); | |||
| switch (func) { | |||
| case GL_LESS: /* (default) pass if incoming z < stored z */ | |||
| @@ -106,7 +106,7 @@ _mesa_DepthMask( GLboolean flag ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glDepthMask %d\n", flag); | |||
| _mesa_debug(ctx, "glDepthMask %d\n", flag); | |||
| /* | |||
| * GL_TRUE indicates depth buffer writing is enabled (default) | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: dlist.c,v 1.89 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: dlist.c,v 1.90 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -4145,9 +4145,6 @@ execute_list( GLcontext *ctx, GLuint list ) | |||
| if (ctx->Driver.BeginCallList) | |||
| ctx->Driver.BeginCallList( ctx, list ); | |||
| /* _mesa_debug("execute list %d\n", list); */ | |||
| /* mesa_print_display_list( list ); */ | |||
| ctx->CallDepth++; | |||
| n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list); | |||
| @@ -4936,7 +4933,8 @@ _mesa_NewList( GLuint list, GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glNewList %u %s\n", list, _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glNewList %u %s\n", list, | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| if (list==0) { | |||
| _mesa_error( ctx, GL_INVALID_VALUE, "glNewList" ); | |||
| @@ -4983,7 +4981,7 @@ _mesa_EndList( void ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glEndList\n"); | |||
| _mesa_debug(ctx, "glEndList\n"); | |||
| /* Check that a list is under construction */ | |||
| if (!ctx->CurrentListPtr) { | |||
| @@ -5026,7 +5024,7 @@ _mesa_CallList( GLuint list ) | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("_mesa_CallList %d\n", list); | |||
| _mesa_debug(ctx, "_mesa_CallList %d\n", list); | |||
| /* mesa_print_display_list( list ); */ | |||
| @@ -5059,7 +5057,7 @@ _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ) | |||
| GLboolean save_compile_flag; | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("_mesa_CallLists %d\n", n); | |||
| _mesa_debug(ctx, "_mesa_CallLists %d\n", n); | |||
| /* Save the CompileFlag status, turn it off, execute display list, | |||
| * and restore the CompileFlag. | |||
| @@ -6162,19 +6160,19 @@ static const char *enum_string( GLenum k ) | |||
| * Print the commands in a display list. For debugging only. | |||
| * TODO: many commands aren't handled yet. | |||
| */ | |||
| static void print_list( GLcontext *ctx, FILE *f, GLuint list ) | |||
| static void print_list( GLcontext *ctx, GLuint list ) | |||
| { | |||
| Node *n; | |||
| GLboolean done; | |||
| if (!glIsList(list)) { | |||
| fprintf(f,"%u is not a display list ID\n",list); | |||
| _mesa_printf(ctx, "%u is not a display list ID\n", list); | |||
| return; | |||
| } | |||
| n = (Node *) _mesa_HashLookup(ctx->Shared->DisplayList, list); | |||
| fprintf( f, "START-LIST %u, address %p\n", list, (void*)n ); | |||
| _mesa_printf(ctx, "START-LIST %u, address %p\n", list, (void*)n ); | |||
| done = n ? GL_FALSE : GL_TRUE; | |||
| while (!done) { | |||
| @@ -6188,149 +6186,164 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list ) | |||
| else { | |||
| switch (opcode) { | |||
| case OPCODE_ACCUM: | |||
| fprintf(f,"accum %s %g\n", enum_string(n[1].e), n[2].f ); | |||
| _mesa_printf(ctx, "accum %s %g\n", enum_string(n[1].e), n[2].f ); | |||
| break; | |||
| case OPCODE_BITMAP: | |||
| fprintf(f,"Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, | |||
| _mesa_printf(ctx, "Bitmap %d %d %g %g %g %g %p\n", n[1].i, n[2].i, | |||
| n[3].f, n[4].f, n[5].f, n[6].f, (void *) n[7].data ); | |||
| break; | |||
| case OPCODE_CALL_LIST: | |||
| fprintf(f,"CallList %d\n", (int) n[1].ui ); | |||
| _mesa_printf(ctx, "CallList %d\n", (int) n[1].ui ); | |||
| break; | |||
| case OPCODE_CALL_LIST_OFFSET: | |||
| fprintf(f,"CallList %d + offset %u = %u\n", (int) n[1].ui, | |||
| _mesa_printf(ctx, "CallList %d + offset %u = %u\n", (int) n[1].ui, | |||
| ctx->List.ListBase, ctx->List.ListBase + n[1].ui ); | |||
| break; | |||
| case OPCODE_COLOR_TABLE_PARAMETER_FV: | |||
| fprintf(f,"ColorTableParameterfv %s %s %f %f %f %f\n", | |||
| _mesa_printf(ctx, "ColorTableParameterfv %s %s %f %f %f %f\n", | |||
| enum_string(n[1].e), enum_string(n[2].e), | |||
| n[3].f, n[4].f, n[5].f, n[6].f); | |||
| break; | |||
| case OPCODE_COLOR_TABLE_PARAMETER_IV: | |||
| fprintf(f,"ColorTableParameteriv %s %s %d %d %d %d\n", | |||
| _mesa_printf(ctx, "ColorTableParameteriv %s %s %d %d %d %d\n", | |||
| enum_string(n[1].e), enum_string(n[2].e), | |||
| n[3].i, n[4].i, n[5].i, n[6].i); | |||
| break; | |||
| case OPCODE_DISABLE: | |||
| fprintf(f,"Disable %s\n", enum_string(n[1].e)); | |||
| _mesa_printf(ctx, "Disable %s\n", enum_string(n[1].e)); | |||
| break; | |||
| case OPCODE_ENABLE: | |||
| fprintf(f,"Enable %s\n", enum_string(n[1].e)); | |||
| _mesa_printf(ctx, "Enable %s\n", enum_string(n[1].e)); | |||
| break; | |||
| case OPCODE_FRUSTUM: | |||
| fprintf(f,"Frustum %g %g %g %g %g %g\n", | |||
| _mesa_printf(ctx, "Frustum %g %g %g %g %g %g\n", | |||
| n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); | |||
| break; | |||
| case OPCODE_LINE_STIPPLE: | |||
| fprintf(f,"LineStipple %d %x\n", n[1].i, (int) n[2].us ); | |||
| _mesa_printf(ctx, "LineStipple %d %x\n", n[1].i, (int) n[2].us ); | |||
| break; | |||
| case OPCODE_LOAD_IDENTITY: | |||
| fprintf(f,"LoadIdentity\n"); | |||
| _mesa_printf(ctx, "LoadIdentity\n"); | |||
| break; | |||
| case OPCODE_LOAD_MATRIX: | |||
| fprintf(f,"LoadMatrix\n"); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); | |||
| _mesa_printf(ctx, "LoadMatrix\n"); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[1].f, n[5].f, n[9].f, n[13].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[2].f, n[6].f, n[10].f, n[14].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[3].f, n[7].f, n[11].f, n[15].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[4].f, n[8].f, n[12].f, n[16].f); | |||
| break; | |||
| case OPCODE_MULT_MATRIX: | |||
| fprintf(f,"MultMatrix (or Rotate)\n"); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[1].f, n[5].f, n[9].f, n[13].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[2].f, n[6].f, n[10].f, n[14].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[3].f, n[7].f, n[11].f, n[15].f); | |||
| fprintf(f," %8f %8f %8f %8f\n", n[4].f, n[8].f, n[12].f, n[16].f); | |||
| _mesa_printf(ctx, "MultMatrix (or Rotate)\n"); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[1].f, n[5].f, n[9].f, n[13].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[2].f, n[6].f, n[10].f, n[14].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[3].f, n[7].f, n[11].f, n[15].f); | |||
| _mesa_printf(ctx, " %8f %8f %8f %8f\n", | |||
| n[4].f, n[8].f, n[12].f, n[16].f); | |||
| break; | |||
| case OPCODE_ORTHO: | |||
| fprintf(f,"Ortho %g %g %g %g %g %g\n", | |||
| _mesa_printf(ctx, "Ortho %g %g %g %g %g %g\n", | |||
| n[1].f, n[2].f, n[3].f, n[4].f, n[5].f, n[6].f ); | |||
| break; | |||
| case OPCODE_POP_ATTRIB: | |||
| fprintf(f,"PopAttrib\n"); | |||
| _mesa_printf(ctx, "PopAttrib\n"); | |||
| break; | |||
| case OPCODE_POP_MATRIX: | |||
| fprintf(f,"PopMatrix\n"); | |||
| _mesa_printf(ctx, "PopMatrix\n"); | |||
| break; | |||
| case OPCODE_POP_NAME: | |||
| fprintf(f,"PopName\n"); | |||
| _mesa_printf(ctx, "PopName\n"); | |||
| break; | |||
| case OPCODE_PUSH_ATTRIB: | |||
| fprintf(f,"PushAttrib %x\n", n[1].bf ); | |||
| _mesa_printf(ctx, "PushAttrib %x\n", n[1].bf ); | |||
| break; | |||
| case OPCODE_PUSH_MATRIX: | |||
| fprintf(f,"PushMatrix\n"); | |||
| _mesa_printf(ctx, "PushMatrix\n"); | |||
| break; | |||
| case OPCODE_PUSH_NAME: | |||
| fprintf(f,"PushName %d\n", (int) n[1].ui ); | |||
| _mesa_printf(ctx, "PushName %d\n", (int) n[1].ui ); | |||
| break; | |||
| case OPCODE_RASTER_POS: | |||
| fprintf(f,"RasterPos %g %g %g %g\n", n[1].f, n[2].f,n[3].f,n[4].f); | |||
| _mesa_printf(ctx, "RasterPos %g %g %g %g\n", | |||
| n[1].f, n[2].f,n[3].f,n[4].f); | |||
| break; | |||
| case OPCODE_ROTATE: | |||
| fprintf(f,"Rotate %g %g %g %g\n", n[1].f, n[2].f, n[3].f, n[4].f ); | |||
| _mesa_printf(ctx, "Rotate %g %g %g %g\n", | |||
| n[1].f, n[2].f, n[3].f, n[4].f ); | |||
| break; | |||
| case OPCODE_SCALE: | |||
| fprintf(f,"Scale %g %g %g\n", n[1].f, n[2].f, n[3].f ); | |||
| _mesa_printf(ctx, "Scale %g %g %g\n", n[1].f, n[2].f, n[3].f ); | |||
| break; | |||
| case OPCODE_TRANSLATE: | |||
| fprintf(f,"Translate %g %g %g\n", n[1].f, n[2].f, n[3].f ); | |||
| _mesa_printf(ctx, "Translate %g %g %g\n", n[1].f, n[2].f, n[3].f ); | |||
| break; | |||
| case OPCODE_BIND_TEXTURE: | |||
| fprintf(f,"BindTexture %s %d\n", _mesa_lookup_enum_by_nr(n[1].ui), | |||
| n[2].ui); | |||
| _mesa_printf(ctx, "BindTexture %s %d\n", | |||
| _mesa_lookup_enum_by_nr(n[1].ui), n[2].ui); | |||
| break; | |||
| case OPCODE_SHADE_MODEL: | |||
| fprintf(f,"ShadeModel %s\n", _mesa_lookup_enum_by_nr(n[1].ui)); | |||
| _mesa_printf(ctx, "ShadeModel %s\n", | |||
| _mesa_lookup_enum_by_nr(n[1].ui)); | |||
| break; | |||
| case OPCODE_MAP1: | |||
| fprintf(f,"Map1 %s %.3f %.3f %d %d\n", | |||
| _mesa_printf(ctx, "Map1 %s %.3f %.3f %d %d\n", | |||
| _mesa_lookup_enum_by_nr(n[1].ui), | |||
| n[2].f, n[3].f, n[4].i, n[5].i); | |||
| break; | |||
| case OPCODE_MAP2: | |||
| fprintf(f,"Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", | |||
| _mesa_lookup_enum_by_nr(n[1].ui), | |||
| n[2].f, n[3].f, n[4].f, n[5].f, | |||
| n[6].i, n[7].i, n[8].i, n[9].i); | |||
| _mesa_printf(ctx, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n", | |||
| _mesa_lookup_enum_by_nr(n[1].ui), | |||
| n[2].f, n[3].f, n[4].f, n[5].f, | |||
| n[6].i, n[7].i, n[8].i, n[9].i); | |||
| break; | |||
| case OPCODE_MAPGRID1: | |||
| fprintf(f,"MapGrid1 %d %.3f %.3f\n", n[1].i, n[2].f, n[3].f); | |||
| _mesa_printf(ctx, "MapGrid1 %d %.3f %.3f\n", | |||
| n[1].i, n[2].f, n[3].f); | |||
| break; | |||
| case OPCODE_MAPGRID2: | |||
| fprintf(f,"MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", | |||
| n[1].i, n[2].f, n[3].f, | |||
| n[4].i, n[5].f, n[6].f); | |||
| _mesa_printf(ctx, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n", | |||
| n[1].i, n[2].f, n[3].f, | |||
| n[4].i, n[5].f, n[6].f); | |||
| break; | |||
| case OPCODE_EVALMESH1: | |||
| fprintf(f,"EvalMesh1 %d %d\n", n[1].i, n[2].i); | |||
| _mesa_printf(ctx, "EvalMesh1 %d %d\n", n[1].i, n[2].i); | |||
| break; | |||
| case OPCODE_EVALMESH2: | |||
| fprintf(f,"EvalMesh2 %d %d %d %d\n", | |||
| n[1].i, n[2].i, n[3].i, n[4].i); | |||
| _mesa_printf(ctx, "EvalMesh2 %d %d %d %d\n", | |||
| n[1].i, n[2].i, n[3].i, n[4].i); | |||
| break; | |||
| /* | |||
| * meta opcodes/commands | |||
| */ | |||
| case OPCODE_ERROR: | |||
| fprintf(f,"Error: %s %s\n", enum_string(n[1].e), (const char *)n[2].data ); | |||
| _mesa_printf(ctx, "Error: %s %s\n", | |||
| enum_string(n[1].e), (const char *)n[2].data ); | |||
| break; | |||
| case OPCODE_CONTINUE: | |||
| fprintf(f,"DISPLAY-LIST-CONTINUE\n"); | |||
| _mesa_printf(ctx, "DISPLAY-LIST-CONTINUE\n"); | |||
| n = (Node *) n[1].next; | |||
| break; | |||
| case OPCODE_END_OF_LIST: | |||
| fprintf(f,"END-LIST %u\n", list); | |||
| _mesa_printf(ctx, "END-LIST %u\n", list); | |||
| done = GL_TRUE; | |||
| break; | |||
| default: | |||
| if (opcode < 0 || opcode > OPCODE_END_OF_LIST) { | |||
| fprintf(f,"ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", | |||
| _mesa_printf(ctx, | |||
| "ERROR IN DISPLAY LIST: opcode = %d, address = %p\n", | |||
| opcode, (void*) n); | |||
| return; | |||
| } | |||
| else { | |||
| fprintf(f,"command %d, %u operands\n",opcode,InstSize[opcode]); | |||
| _mesa_printf(ctx, "command %d, %u operands\n", | |||
| opcode, InstSize[opcode]); | |||
| } | |||
| } | |||
| /* increment n to point to next compiled command */ | |||
| @@ -6351,5 +6364,5 @@ static void print_list( GLcontext *ctx, FILE *f, GLuint list ) | |||
| void mesa_print_display_list( GLuint list ) | |||
| { | |||
| GET_CURRENT_CONTEXT(ctx); | |||
| print_list( ctx, stderr, list ); | |||
| print_list( ctx, list ); | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: drawpix.c,v 1.60 2002/05/09 21:54:16 brianp Exp $ */ | |||
| /* $Id: drawpix.c,v 1.61 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -223,3 +223,68 @@ _mesa_Bitmap( GLsizei width, GLsizei height, | |||
| ctx->Current.RasterPos[0] += xmove; | |||
| ctx->Current.RasterPos[1] += ymove; | |||
| } | |||
| #if 0 /* experimental */ | |||
| /* | |||
| * Execute glDrawDepthPixelsMESA(). This function accepts both a color | |||
| * image and depth (Z) image. Rasterization produces fragments with | |||
| * color and Z taken from these images. This function is intended for | |||
| * Z-compositing. Normally, this operation requires two glDrawPixels | |||
| * calls with stencil testing. | |||
| */ | |||
| void | |||
| _mesa_DrawDepthPixelsMESA( GLsizei width, GLsizei height, | |||
| GLenum colorFormat, GLenum colorType, | |||
| const GLvoid *colors, | |||
| GLenum depthType, const GLvoid *depths ) | |||
| { | |||
| GET_CURRENT_CONTEXT(ctx); | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (width < 0 || height < 0) { | |||
| _mesa_error( ctx, GL_INVALID_VALUE, | |||
| "glDrawDepthPixelsMESA(width or height < 0" ); | |||
| return; | |||
| } | |||
| if (ctx->RenderMode==GL_RENDER) { | |||
| GLint x, y; | |||
| if (!colors || !depths || !ctx->Current.RasterPosValid) { | |||
| return; | |||
| } | |||
| if (ctx->NewState) { | |||
| _mesa_update_state(ctx); | |||
| } | |||
| /* Round, to satisfy conformance tests (matches SGI's OpenGL) */ | |||
| x = IROUND(ctx->Current.RasterPos[0]); | |||
| y = IROUND(ctx->Current.RasterPos[1]); | |||
| ctx->OcclusionResult = GL_TRUE; | |||
| ctx->Driver.DrawDepthPixelsMESA(ctx, x, y, width, height, | |||
| colorFormat, colorType, colors, | |||
| depthType, depths, &ctx->Unpack); | |||
| } | |||
| else if (ctx->RenderMode==GL_FEEDBACK) { | |||
| /* Feedback the current raster pos info */ | |||
| if (ctx->Current.RasterPosValid) { | |||
| FLUSH_CURRENT( ctx, 0 ); | |||
| FEEDBACK_TOKEN( ctx, (GLfloat) (GLint) GL_DRAW_PIXEL_TOKEN ); | |||
| _mesa_feedback_vertex( ctx, | |||
| ctx->Current.RasterPos, | |||
| ctx->Current.RasterColor, | |||
| ctx->Current.RasterIndex, | |||
| ctx->Current.RasterTexCoords[0] ); | |||
| } | |||
| } | |||
| else if (ctx->RenderMode==GL_SELECT) { | |||
| if (ctx->Current.RasterPosValid) { | |||
| _mesa_update_hitflag( ctx, ctx->Current.RasterPos[2] ); | |||
| } | |||
| } | |||
| } | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: enable.c,v 1.64 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: enable.c,v 1.65 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -173,7 +173,7 @@ _mesa_DisableClientState( GLenum cap ) | |||
| void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
| { | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("%s %s (newstate is %x)\n", | |||
| _mesa_debug(ctx, "%s %s (newstate is %x)\n", | |||
| state ? "glEnable" : "glDisable", | |||
| _mesa_lookup_enum_by_nr(cap), | |||
| ctx->NewState); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: get.c,v 1.80 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: get.c,v 1.81 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -128,7 +128,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) | |||
| FLUSH_VERTICES(ctx, 0); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| _mesa_debug(ctx, "glGetBooleanv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| if (ctx->Driver.GetBooleanv | |||
| && (*ctx->Driver.GetBooleanv)(ctx, pname, params)) | |||
| @@ -1465,7 +1465,7 @@ _mesa_GetDoublev( GLenum pname, GLdouble *params ) | |||
| FLUSH_VERTICES(ctx, 0); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| _mesa_debug(ctx, "glGetDoublev %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params)) | |||
| return; | |||
| @@ -2708,7 +2708,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) | |||
| FLUSH_VERTICES(ctx, 0); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| _mesa_debug(ctx, "glGetFloatv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params)) | |||
| return; | |||
| @@ -3920,7 +3920,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) | |||
| FLUSH_VERTICES(ctx, 0); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| _mesa_debug(ctx, "glGetIntegerv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| if (ctx->Driver.GetIntegerv | |||
| && (*ctx->Driver.GetIntegerv)(ctx, pname, params)) | |||
| @@ -5171,7 +5171,7 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params ) | |||
| return; | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname)); | |||
| if (ctx->Driver.GetPointerv | |||
| && (*ctx->Driver.GetPointerv)(ctx, pname, params)) | |||
| @@ -5271,7 +5271,7 @@ _mesa_GetError( void ) | |||
| ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e)); | |||
| _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e)); | |||
| ctx->ErrorValue = (GLenum) GL_NO_ERROR; | |||
| return e; | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: glheader.h,v 1.27 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: glheader.h,v 1.28 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -66,16 +66,13 @@ | |||
| #endif | |||
| #endif | |||
| #include <float.h> | |||
| #include <stdarg.h> | |||
| #ifdef HAVE_CONFIG_H | |||
| #include "conf.h" | |||
| #endif | |||
| #ifdef DEBUG | |||
| #include <stdarg.h> /* for _mesa_debug() only */ | |||
| #endif | |||
| #if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) | |||
| # define __WIN32__ | |||
| @@ -259,6 +256,17 @@ typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESC | |||
| #endif | |||
| /* | |||
| * Provide a reasonable replacement for __FUNCTION__ when using | |||
| * non-GNU C compilers. | |||
| */ | |||
| #if !defined(__GNUC__) | |||
| #define STRINGIZE(x) #x | |||
| #define STRINGIZE_EVAL(x) STRINGIZE(x) | |||
| #define __FUNCTION__ STRINGIZE_EVAL(__FILE__) ", line " STRINGIZE_EVAL(__LINE__) | |||
| #endif | |||
| /* Some compilers don't like some of Mesa's const usage */ | |||
| #ifdef NO_CONST | |||
| # define CONST | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: hint.c,v 1.11 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: hint.c,v 1.12 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -42,49 +42,43 @@ _mesa_Hint( GLenum target, GLenum mode ) | |||
| { | |||
| GET_CURRENT_CONTEXT(ctx); | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| (void) _mesa_try_Hint( ctx, target, mode ); | |||
| } | |||
| GLboolean | |||
| _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode ) | |||
| { | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glHint %s %d\n", _mesa_lookup_enum_by_nr(target), mode); | |||
| if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) { | |||
| _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)"); | |||
| return GL_FALSE; | |||
| return; | |||
| } | |||
| switch (target) { | |||
| case GL_FOG_HINT: | |||
| if (ctx->Hint.Fog == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.Fog = mode; | |||
| break; | |||
| case GL_LINE_SMOOTH_HINT: | |||
| if (ctx->Hint.LineSmooth == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.LineSmooth = mode; | |||
| break; | |||
| case GL_PERSPECTIVE_CORRECTION_HINT: | |||
| if (ctx->Hint.PerspectiveCorrection == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.PerspectiveCorrection = mode; | |||
| break; | |||
| case GL_POINT_SMOOTH_HINT: | |||
| if (ctx->Hint.PointSmooth == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.PointSmooth = mode; | |||
| break; | |||
| case GL_POLYGON_SMOOTH_HINT: | |||
| if (ctx->Hint.PolygonSmooth == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.PolygonSmooth = mode; | |||
| break; | |||
| @@ -92,7 +86,7 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode ) | |||
| /* GL_EXT_clip_volume_hint */ | |||
| case GL_CLIP_VOLUME_CLIPPING_HINT_EXT: | |||
| if (ctx->Hint.ClipVolumeClipping == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.ClipVolumeClipping = mode; | |||
| break; | |||
| @@ -101,10 +95,10 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode ) | |||
| case GL_TEXTURE_COMPRESSION_HINT_ARB: | |||
| if (!ctx->Extensions.ARB_texture_compression) { | |||
| _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); | |||
| return GL_FALSE; | |||
| return; | |||
| } | |||
| if (ctx->Hint.TextureCompression == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.TextureCompression = mode; | |||
| break; | |||
| @@ -113,22 +107,20 @@ _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode ) | |||
| case GL_GENERATE_MIPMAP_HINT_SGIS: | |||
| if (!ctx->Extensions.SGIS_generate_mipmap) { | |||
| _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); | |||
| return GL_FALSE; | |||
| return; | |||
| } | |||
| if (ctx->Hint.GenerateMipmap == mode) | |||
| return GL_TRUE; | |||
| return; | |||
| FLUSH_VERTICES(ctx, _NEW_HINT); | |||
| ctx->Hint.GenerateMipmap = mode; | |||
| break; | |||
| default: | |||
| _mesa_error(ctx, GL_INVALID_ENUM, "glHint(target)"); | |||
| return GL_FALSE; | |||
| return; | |||
| } | |||
| if (ctx->Driver.Hint) { | |||
| (*ctx->Driver.Hint)( ctx, target, mode ); | |||
| } | |||
| return GL_TRUE; | |||
| } | |||
| @@ -1,10 +1,10 @@ | |||
| /* $Id: hint.h,v 1.3 2001/01/24 04:56:20 brianp Exp $ */ | |||
| /* $Id: hint.h,v 1.4 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| * Version: 3.5 | |||
| * Version: 4.1 | |||
| * | |||
| * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. | |||
| * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. | |||
| * | |||
| * Permission is hereby granted, free of charge, to any person obtaining a | |||
| * copy of this software and associated documentation files (the "Software"), | |||
| @@ -32,9 +32,6 @@ | |||
| #include "mtypes.h" | |||
| extern GLboolean | |||
| _mesa_try_Hint( GLcontext *ctx, GLenum target, GLenum mode ); | |||
| extern void | |||
| _mesa_Hint( GLenum target, GLenum mode ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: imports.c,v 1.12 2002/06/13 08:27:32 joukj Exp $ */ | |||
| /* $Id: imports.c,v 1.13 2002/06/15 02:38:15 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -39,12 +39,20 @@ | |||
| * the renderer should use the XFree86-wrapped system calls. | |||
| */ | |||
| #include <stdarg.h> | |||
| /* | |||
| * XXX when we fully implement the __GLimports mechanism in Mesa, that | |||
| * should mean that we can remove <stdio.h>, <stdlib.h>, etc, from | |||
| * glheader.h. Strictly speaking, all system includes should be done | |||
| * from this file, and not glheader to ensure that core Mesa has no | |||
| * dependencies on external libraries. Someday... | |||
| */ | |||
| #include "glheader.h" | |||
| #include "imports.h" | |||
| #include "mem.h" | |||
| #include "mtypes.h" | |||
| static void * | |||
| _mesa_Malloc(__GLcontext *gc, size_t size) | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: light.c,v 1.50 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: light.c,v 1.51 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -57,7 +57,7 @@ _mesa_ShadeModel( GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glShadeModel %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| if (mode != GL_FLAT && mode != GL_SMOOTH) { | |||
| _mesa_error( ctx, GL_INVALID_ENUM, "glShadeModel" ); | |||
| @@ -617,7 +617,7 @@ void _mesa_update_material( GLcontext *ctx, | |||
| bitmask &= ~ctx->Light.ColorMaterialBitmask; | |||
| if (MESA_VERBOSE&VERBOSE_IMMEDIATE) | |||
| _mesa_debug("_mesa_update_material, mask 0x%x\n", bitmask); | |||
| _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); | |||
| if (!bitmask) | |||
| return; | |||
| @@ -714,25 +714,16 @@ void _mesa_update_material( GLcontext *ctx, | |||
| ctx->Light.Material[1].SpecularIndex = src[1].SpecularIndex; | |||
| } | |||
| if (0) | |||
| { | |||
| if (0) { | |||
| struct gl_material *mat = &ctx->Light.Material[0]; | |||
| _mesa_debug("update_mat emission : %f %f %f\n", | |||
| mat->Emission[0], | |||
| mat->Emission[1], | |||
| mat->Emission[2]); | |||
| _mesa_debug("update_mat specular : %f %f %f\n", | |||
| mat->Specular[0], | |||
| mat->Specular[1], | |||
| mat->Specular[2]); | |||
| _mesa_debug("update_mat diffuse : %f %f %f\n", | |||
| mat->Diffuse[0], | |||
| mat->Diffuse[1], | |||
| mat->Diffuse[2]); | |||
| _mesa_debug("update_mat ambient : %f %f %f\n", | |||
| mat->Ambient[0], | |||
| mat->Ambient[1], | |||
| mat->Ambient[2]); | |||
| _mesa_debug(ctx, "update_mat emission : %f %f %f\n", | |||
| mat->Emission[0], mat->Emission[1], mat->Emission[2]); | |||
| _mesa_debug(ctx, "update_mat specular : %f %f %f\n", | |||
| mat->Specular[0], mat->Specular[1], mat->Specular[2]); | |||
| _mesa_debug(ctx, "update_mat diffuse : %f %f %f\n", | |||
| mat->Diffuse[0], mat->Diffuse[1], mat->Diffuse[2]); | |||
| _mesa_debug(ctx, "update_mat ambient : %f %f %f\n", | |||
| mat->Ambient[0], mat->Ambient[1], mat->Ambient[2]); | |||
| } | |||
| } | |||
| @@ -754,7 +745,7 @@ void _mesa_update_color_material( GLcontext *ctx, | |||
| GLuint bitmask = ctx->Light.ColorMaterialBitmask; | |||
| if (MESA_VERBOSE&VERBOSE_IMMEDIATE) | |||
| _mesa_debug("_mesa_update_color_material, mask 0x%x\n", bitmask); | |||
| _mesa_debug(ctx, "_mesa_update_color_material, mask 0x%x\n", bitmask); | |||
| /* update emissive colors */ | |||
| if (bitmask & FRONT_EMISSION_BIT) { | |||
| @@ -831,25 +822,16 @@ void _mesa_update_color_material( GLcontext *ctx, | |||
| } | |||
| } | |||
| if (0) | |||
| { | |||
| if (0) { | |||
| struct gl_material *mat = &ctx->Light.Material[0]; | |||
| _mesa_debug("update_color_mat emission : %f %f %f\n", | |||
| mat->Emission[0], | |||
| mat->Emission[1], | |||
| mat->Emission[2]); | |||
| _mesa_debug("update_color_mat specular : %f %f %f\n", | |||
| mat->Specular[0], | |||
| mat->Specular[1], | |||
| mat->Specular[2]); | |||
| _mesa_debug("update_color_mat diffuse : %f %f %f\n", | |||
| mat->Diffuse[0], | |||
| mat->Diffuse[1], | |||
| mat->Diffuse[2]); | |||
| _mesa_debug("update_color_mat ambient : %f %f %f\n", | |||
| mat->Ambient[0], | |||
| mat->Ambient[1], | |||
| mat->Ambient[2]); | |||
| _mesa_debug(ctx, "update_color_mat emission : %f %f %f\n", | |||
| mat->Emission[0], mat->Emission[1], mat->Emission[2]); | |||
| _mesa_debug(ctx, "update_color_mat specular : %f %f %f\n", | |||
| mat->Specular[0], mat->Specular[1], mat->Specular[2]); | |||
| _mesa_debug(ctx, "update_color_mat diffuse : %f %f %f\n", | |||
| mat->Diffuse[0], mat->Diffuse[1], mat->Diffuse[2]); | |||
| _mesa_debug(ctx, "update_color_mat ambient : %f %f %f\n", | |||
| mat->Ambient[0], mat->Ambient[1], mat->Ambient[2]); | |||
| } | |||
| } | |||
| @@ -868,9 +850,9 @@ _mesa_ColorMaterial( GLenum face, GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glColorMaterial %s %s\n", | |||
| _mesa_lookup_enum_by_nr(face), | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glColorMaterial %s %s\n", | |||
| _mesa_lookup_enum_by_nr(face), | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial"); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: matrix.c,v 1.41 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: matrix.c,v 1.42 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -157,8 +157,8 @@ _mesa_PushMatrix( void ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glPushMatrix %s\n", | |||
| _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); | |||
| _mesa_debug(ctx, "glPushMatrix %s\n", | |||
| _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); | |||
| if (stack->Depth + 1 >= stack->MaxDepth) { | |||
| _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushMatrix" ); | |||
| @@ -181,8 +181,8 @@ _mesa_PopMatrix( void ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glPopMatrix %s\n", | |||
| _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); | |||
| _mesa_debug(ctx, "glPopMatrix %s\n", | |||
| _mesa_lookup_enum_by_nr(ctx->Transform.MatrixMode)); | |||
| if (stack->Depth == 0) { | |||
| _mesa_error( ctx, GL_STACK_UNDERFLOW, "glPopMatrix" ); | |||
| @@ -390,7 +390,7 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y, | |||
| } | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glViewport %d %d %d %d\n", x, y, width, height); | |||
| _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height); | |||
| /* clamp width, and height to implementation dependent range */ | |||
| width = CLAMP( width, 1, MAX_WIDTH ); | |||
| @@ -446,7 +446,7 @@ _mesa_DepthRange( GLclampd nearval, GLclampd farval ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glDepthRange %f %f\n", nearval, farval); | |||
| _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval); | |||
| n = (GLfloat) CLAMP( nearval, 0.0, 1.0 ); | |||
| f = (GLfloat) CLAMP( farval, 0.0, 1.0 ); | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: mtypes.h,v 1.78 2002/06/13 04:28:29 brianp Exp $ */ | |||
| /* $Id: mtypes.h,v 1.79 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -1857,15 +1857,6 @@ enum _debug { | |||
| #define Elements(x) sizeof(x)/sizeof(*(x)) | |||
| /* | |||
| * Provide a reasonable replacement for __FUNCTION__ when using | |||
| * non-GNU C compilers. | |||
| */ | |||
| #if !defined(__GNUC__) | |||
| #define STRINGIZE(x) #x | |||
| #define STRINGIZE_EVAL(x) STRINGIZE(x) | |||
| #define __FUNCTION__ STRINGIZE_EVAL(__FILE__) ", line " STRINGIZE_EVAL(__LINE__) | |||
| #endif | |||
| /* Eventually let the driver specify what statechanges require a flush: | |||
| */ | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: polygon.c,v 1.22 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: polygon.c,v 1.23 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -47,7 +47,7 @@ _mesa_CullFace( GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glCullFace %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glCullFace %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) { | |||
| _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" ); | |||
| @@ -73,7 +73,7 @@ _mesa_FrontFace( GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| _mesa_debug(ctx, "glFrontFace %s\n", _mesa_lookup_enum_by_nr(mode)); | |||
| if (mode!=GL_CW && mode!=GL_CCW) { | |||
| _mesa_error( ctx, GL_INVALID_ENUM, "glFrontFace" ); | |||
| @@ -101,7 +101,7 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glPolygonMode %s %s\n", | |||
| _mesa_debug(ctx, "glPolygonMode %s %s\n", | |||
| _mesa_lookup_enum_by_nr(face), | |||
| _mesa_lookup_enum_by_nr(mode)); | |||
| @@ -154,7 +154,7 @@ _mesa_PolygonStipple( const GLubyte *pattern ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glPolygonStipple\n"); | |||
| _mesa_debug(ctx, "glPolygonStipple\n"); | |||
| FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE); | |||
| _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); | |||
| @@ -172,7 +172,7 @@ _mesa_GetPolygonStipple( GLubyte *dest ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glGetPolygonStipple\n"); | |||
| _mesa_debug(ctx, "glGetPolygonStipple\n"); | |||
| _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack); | |||
| } | |||
| @@ -186,7 +186,7 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&VERBOSE_API) | |||
| _mesa_debug("glPolygonOffset %f %f\n", factor, units); | |||
| _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units); | |||
| if (ctx->Polygon.OffsetFactor == factor && | |||
| ctx->Polygon.OffsetUnits == units) | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: texformat.c,v 1.11 2001/06/15 14:18:46 brianp Exp $ */ | |||
| /* $Id: texformat.c,v 1.12 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -438,6 +438,153 @@ const struct gl_texture_format _mesa_texformat_ci8 = { | |||
| }; | |||
| /* Big-endian */ | |||
| #if 0 | |||
| const struct gl_texture_format _mesa_texformat_abgr8888 = { | |||
| MESA_FORMAT_ABGR8888, /* MesaFormat */ | |||
| GL_RGBA, /* BaseFormat */ | |||
| GL_UNSIGNED_INT_8_8_8_8, /* Type */ | |||
| 8, /* RedBits */ | |||
| 8, /* GreenBits */ | |||
| 8, /* BlueBits */ | |||
| 8, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 4, /* TexelBytes */ | |||
| fetch_1d_texel_abgr8888, /* FetchTexel1D */ | |||
| fetch_2d_texel_abgr8888, /* FetchTexel2D */ | |||
| fetch_3d_texel_abgr8888, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgra8888 = { | |||
| MESA_FORMAT_BGRA8888, /* MesaFormat */ | |||
| GL_RGBA, /* BaseFormat */ | |||
| GL_UNSIGNED_INT_8_8_8_8, /* Type */ | |||
| 8, /* RedBits */ | |||
| 8, /* GreenBits */ | |||
| 8, /* BlueBits */ | |||
| 8, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 4, /* TexelBytes */ | |||
| fetch_1d_texel_bgra8888, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgra8888, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgra8888, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgr888 = { | |||
| MESA_FORMAT_BGR888, /* MesaFormat */ | |||
| GL_RGB, /* BaseFormat */ | |||
| GL_UNSIGNED_BYTE, /* Type */ | |||
| 8, /* RedBits */ | |||
| 8, /* GreenBits */ | |||
| 8, /* BlueBits */ | |||
| 0, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 3, /* TexelBytes */ | |||
| fetch_1d_texel_bgr888, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgr888, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgr888, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgr565 = { | |||
| MESA_FORMAT_BGR565, /* MesaFormat */ | |||
| GL_RGB, /* BaseFormat */ | |||
| GL_UNSIGNED_SHORT_5_6_5, /* Type */ | |||
| 5, /* RedBits */ | |||
| 6, /* GreenBits */ | |||
| 5, /* BlueBits */ | |||
| 0, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 2, /* TexelBytes */ | |||
| fetch_1d_texel_bgr565, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgr565, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgr565, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgra4444 = { | |||
| MESA_FORMAT_BGRA4444, /* MesaFormat */ | |||
| GL_RGBA, /* BaseFormat */ | |||
| GL_UNSIGNED_SHORT_4_4_4_4_REV, /* Type */ | |||
| 4, /* RedBits */ | |||
| 4, /* GreenBits */ | |||
| 4, /* BlueBits */ | |||
| 4, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 2, /* TexelBytes */ | |||
| fetch_1d_texel_bgra4444, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgra4444, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgra4444, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgra5551 = { | |||
| MESA_FORMAT_BGRA5551, /* MesaFormat */ | |||
| GL_RGBA, /* BaseFormat */ | |||
| GL_UNSIGNED_SHORT_1_5_5_5_REV, /* Type */ | |||
| 5, /* RedBits */ | |||
| 5, /* GreenBits */ | |||
| 5, /* BlueBits */ | |||
| 1, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 2, /* TexelBytes */ | |||
| fetch_1d_texel_bgra1555, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgra1555, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgra1555, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_la88 = { | |||
| MESA_FORMAT_LA88, /* MesaFormat */ | |||
| GL_LUMINANCE_ALPHA, /* BaseFormat */ | |||
| GL_UNSIGNED_BYTE, /* Type */ | |||
| 0, /* RedBits */ | |||
| 0, /* GreenBits */ | |||
| 0, /* BlueBits */ | |||
| 8, /* AlphaBits */ | |||
| 8, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 2, /* TexelBytes */ | |||
| fetch_1d_texel_la88, /* FetchTexel1D */ | |||
| fetch_2d_texel_la88, /* FetchTexel2D */ | |||
| fetch_3d_texel_la88, /* FetchTexel3D */ | |||
| }; | |||
| const struct gl_texture_format _mesa_texformat_bgr233 = { | |||
| MESA_FORMAT_BGR233, /* MesaFormat */ | |||
| GL_RGB, /* BaseFormat */ | |||
| GL_UNSIGNED_BYTE_3_3_2, /* Type */ | |||
| 3, /* RedBits */ | |||
| 3, /* GreenBits */ | |||
| 2, /* BlueBits */ | |||
| 0, /* AlphaBits */ | |||
| 0, /* LuminanceBits */ | |||
| 0, /* IntensityBits */ | |||
| 0, /* IndexBits */ | |||
| 0, /* DepthBits */ | |||
| 1, /* TexelBytes */ | |||
| fetch_1d_texel_bgr233, /* FetchTexel1D */ | |||
| fetch_2d_texel_bgr233, /* FetchTexel2D */ | |||
| fetch_3d_texel_bgr233, /* FetchTexel3D */ | |||
| }; | |||
| #endif | |||
| /* ============================================================= | |||
| * Null format: | |||
| */ | |||
| @@ -472,8 +619,8 @@ _mesa_is_hardware_tex_format( const struct gl_texture_format *format ) | |||
| /* Given an internal texture format (or 1, 2, 3, 4) return a pointer | |||
| * to a gl_texture_format which which to store the texture. | |||
| * This is called via ctx->Driver.ChooseTextureFormat(). | |||
| * Hardware drivers should not use this function, but instead a | |||
| * specialized function. | |||
| * Hardware drivers typically override this function with a specialized | |||
| * version. | |||
| */ | |||
| const struct gl_texture_format * | |||
| _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: texformat.h,v 1.8 2002/06/12 00:52:50 brianp Exp $ */ | |||
| /* $Id: texformat.h,v 1.9 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -33,12 +33,15 @@ | |||
| #include "mtypes.h" | |||
| /* The Mesa internal texture image types. These will be set to their | |||
| * default value, but may be changed by drivers as required. | |||
| /* | |||
| * The Mesa internal texture image types. | |||
| * All texture images must be stored in one of these formats. | |||
| */ | |||
| enum _format { | |||
| /* Hardware-friendly formats. Drivers can override the default | |||
| * formats and convert texture images to one of these as required. | |||
| * The driver's ChooseTextureFormat() function will choose one of | |||
| * these formats. | |||
| * These formats are all little endian, as shown below. They will be | |||
| * most useful for x86-based PC graphics card drivers. | |||
| * | |||
| @@ -85,7 +88,7 @@ enum _format { | |||
| * | |||
| * NOTE: Because these are based on the GLchan datatype, one cannot | |||
| * assume 8 bits per channel with these formats. If you require | |||
| * GLubyte per channel, use one of the hardware formats above. | |||
| * GLubyte channels, use one of the hardware formats above. | |||
| */ | |||
| MESA_FORMAT_RGBA, | |||
| MESA_FORMAT_RGB, | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: texformat_tmp.h,v 1.4 2002/05/09 20:51:05 keithw Exp $ */ | |||
| /* $Id: texformat_tmp.h,v 1.5 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -284,6 +284,98 @@ static void FETCH(ci8)( const struct gl_texture_image *texImage, | |||
| } | |||
| /* big-endian */ | |||
| static void FETCH(abgr8888)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 4 ); | |||
| GLchan *rgba = (GLchan *) texel; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( src[3] ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( src[2] ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( src[1] ); | |||
| rgba[ACOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| } | |||
| static void FETCH(bgra8888)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 4 ); | |||
| GLchan *rgba = (GLchan *) texel; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( src[2] ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( src[1] ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| rgba[ACOMP] = UBYTE_TO_CHAN( src[3] ); | |||
| } | |||
| static void FETCH(bgr888)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 3 ); | |||
| GLchan *rgba = (GLchan *) texel; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( src[2] ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( src[1] ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| rgba[ACOMP] = CHAN_MAX; | |||
| } | |||
| static void FETCH(bgr565)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLushort *src = USHORT_SRC( texImage, i, j, k ); | |||
| GLchan *rgba = (GLchan *) texel; GLushort s = *src; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf8) * 255 / 0xf8 ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 3) & 0xfc) * 255 / 0xfc ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xf8) * 255 / 0xf8 ); | |||
| rgba[ACOMP] = CHAN_MAX; | |||
| } | |||
| static void FETCH(bgra4444)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLushort *src = USHORT_SRC( texImage, i, j, k ); | |||
| GLchan *rgba = (GLchan *) texel; GLushort s = *src; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 8) & 0xf) * 255 / 0xf ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 4) & 0xf) * 255 / 0xf ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0xf) * 255 / 0xf ); | |||
| rgba[ACOMP] = UBYTE_TO_CHAN( ((s >> 12) & 0xf) * 255 / 0xf ); | |||
| } | |||
| static void FETCH(bgra5551)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLushort *src = USHORT_SRC( texImage, i, j, k ); | |||
| GLchan *rgba = (GLchan *) texel; GLushort s = *src; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( ((s >> 10) & 0x1f) * 255 / 0x1f ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( ((s >> 5) & 0x1f) * 255 / 0x1f ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( ((s ) & 0x1f) * 255 / 0x1f ); | |||
| rgba[ACOMP] = UBYTE_TO_CHAN( ((s >> 15) & 0x01) * 255 ); | |||
| } | |||
| static void FETCH(la88)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 2 ); | |||
| GLchan *rgba = (GLchan *) texel; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( src[0] ); | |||
| rgba[ACOMP] = UBYTE_TO_CHAN( src[1] ); | |||
| } | |||
| static void FETCH(bgr233)( const struct gl_texture_image *texImage, | |||
| GLint i, GLint j, GLint k, GLvoid *texel ) | |||
| { | |||
| const GLubyte *src = UBYTE_SRC( texImage, i, j, k, 1 ); | |||
| GLchan *rgba = (GLchan *) texel; GLubyte s = *src; | |||
| rgba[RCOMP] = UBYTE_TO_CHAN( ((s ) & 0xe0) * 255 / 0xe0 ); | |||
| rgba[GCOMP] = UBYTE_TO_CHAN( ((s << 3) & 0xe0) * 255 / 0xe0 ); | |||
| rgba[BCOMP] = UBYTE_TO_CHAN( ((s << 5) & 0xc0) * 255 / 0xc0 ); | |||
| rgba[ACOMP] = CHAN_MAX; | |||
| } | |||
| #undef CHAN_SRC | |||
| #undef UBYTE_SRC | |||
| #undef USHORT_SRC | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: texobj.c,v 1.53 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: texobj.c,v 1.54 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -565,7 +565,7 @@ _mesa_BindTexture( GLenum target, GLuint texName ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glBindTexture %s %d\n", | |||
| _mesa_debug(ctx, "glBindTexture %s %d\n", | |||
| _mesa_lookup_enum_by_nr(target), (GLint) texName); | |||
| switch (target) { | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: texstate.c,v 1.73 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: texstate.c,v 1.74 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -454,7 +454,7 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glTexEnv %s %s %.1f(%s) ...\n", | |||
| _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n", | |||
| _mesa_lookup_enum_by_nr(target), | |||
| _mesa_lookup_enum_by_nr(pname), | |||
| *param, | |||
| @@ -950,7 +950,7 @@ _mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("texPARAM %s %s %d...\n", | |||
| _mesa_debug(ctx, "texPARAM %s %s %d...\n", | |||
| _mesa_lookup_enum_by_nr(target), | |||
| _mesa_lookup_enum_by_nr(pname), | |||
| eparam); | |||
| @@ -1764,7 +1764,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("texGEN %s %s %x...\n", | |||
| _mesa_debug(ctx, "texGEN %s %s %x...\n", | |||
| _mesa_lookup_enum_by_nr(coord), | |||
| _mesa_lookup_enum_by_nr(pname), | |||
| *(int *)params); | |||
| @@ -2303,7 +2303,7 @@ _mesa_ActiveTextureARB( GLenum target ) | |||
| ASSERT_OUTSIDE_BEGIN_END(ctx); | |||
| if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
| _mesa_debug("glActiveTexture %s\n", | |||
| _mesa_debug(ctx, "glActiveTexture %s\n", | |||
| _mesa_lookup_enum_by_nr(target)); | |||
| if (texUnit > ctx->Const.MaxTextureUnits) { | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: varray.c,v 1.44 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: varray.c,v 1.45 2002/06/15 02:38:16 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -60,9 +60,8 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) | |||
| _mesa_debug("glVertexPointer( sz %d type %s stride %d )\n", size, | |||
| _mesa_lookup_enum_by_nr( type ), | |||
| stride); | |||
| _mesa_debug(ctx, "glVertexPointer( sz %d type %s stride %d )\n", size, | |||
| _mesa_lookup_enum_by_nr( type ), stride); | |||
| /* always need to check that <type> is legal */ | |||
| switch (type) { | |||
| @@ -112,9 +111,8 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) | |||
| _mesa_debug("glNormalPointer( type %s stride %d )\n", | |||
| _mesa_lookup_enum_by_nr( type ), | |||
| stride); | |||
| _mesa_debug(ctx, "glNormalPointer( type %s stride %d )\n", | |||
| _mesa_lookup_enum_by_nr( type ), stride); | |||
| switch (type) { | |||
| case GL_BYTE: | |||
| @@ -168,9 +166,8 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) | |||
| _mesa_debug("glColorPointer( sz %d type %s stride %d )\n", size, | |||
| _mesa_lookup_enum_by_nr( type ), | |||
| stride); | |||
| _mesa_debug(ctx, "glColorPointer( sz %d type %s stride %d )\n", size, | |||
| _mesa_lookup_enum_by_nr( type ), stride); | |||
| switch (type) { | |||
| case GL_BYTE: | |||
| @@ -320,7 +317,7 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) | |||
| _mesa_debug("glSecondaryColorPointer( sz %d type %s stride %d )\n", | |||
| _mesa_debug(ctx, "glSecondaryColorPointer( sz %d type %s stride %d )\n", | |||
| size, _mesa_lookup_enum_by_nr( type ), stride); | |||
| switch (type) { | |||
| @@ -387,11 +384,8 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, | |||
| } | |||
| if (MESA_VERBOSE&(VERBOSE_VARRAY|VERBOSE_API)) | |||
| _mesa_debug("glTexCoordPointer( unit %u sz %d type %s stride %d )\n", | |||
| texUnit, | |||
| size, | |||
| _mesa_lookup_enum_by_nr( type ), | |||
| stride); | |||
| _mesa_debug(ctx, "glTexCoordPointer(unit %u sz %d type %s stride %d)\n", | |||
| texUnit, size, _mesa_lookup_enum_by_nr( type ), stride); | |||
| /* always need to check that <type> is legal */ | |||
| switch (type) { | |||
| @@ -768,7 +762,7 @@ _mesa_LockArraysEXT(GLint first, GLsizei count) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glLockArrays %d %d\n", first, count); | |||
| _mesa_debug(ctx, "glLockArrays %d %d\n", first, count); | |||
| if (first == 0 && count > 0 && | |||
| count <= (GLint) ctx->Const.MaxArrayLockSize) { | |||
| @@ -795,7 +789,7 @@ _mesa_UnlockArraysEXT( void ) | |||
| ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("glUnlockArrays\n"); | |||
| _mesa_debug(ctx, "glUnlockArrays\n"); | |||
| ctx->Array.LockFirst = 0; | |||
| ctx->Array.LockCount = 0; | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: m_xform.c,v 1.15 2002/04/09 14:58:04 keithw Exp $ */ | |||
| /* $Id: m_xform.c,v 1.16 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -207,7 +207,7 @@ _math_init_transformation( void ) | |||
| _math_test_all_cliptest_functions( "default" ); | |||
| #endif | |||
| #ifdef USE_X86_ASM | |||
| #ifdef USE_X86_ASM_foo | |||
| _mesa_init_all_x86_transform_asm(); | |||
| #endif | |||
| #ifdef USE_SPARC_ASM | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_accum.c,v 1.16 2002/03/19 16:47:05 brianp Exp $ */ | |||
| /* $Id: s_accum.c,v 1.17 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -62,7 +62,7 @@ | |||
| */ | |||
| #if CHAN_BITS == 8 | |||
| #if CHAN_BITS == 8 && ACCUM_BITS < 32 | |||
| #define USE_OPTIMIZED_ACCUM /* enable the optimization */ | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_buffers.c,v 1.10 2002/03/16 00:53:15 brianp Exp $ */ | |||
| /* $Id: s_buffers.c,v 1.11 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -169,20 +169,20 @@ clear_color_buffers(GLcontext *ctx) | |||
| for (bufferBit = 1; bufferBit <= 8; bufferBit = bufferBit << 1) { | |||
| if (bufferBit & ctx->Color.DrawDestMask) { | |||
| if (bufferBit == FRONT_LEFT_BIT) { | |||
| (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT); | |||
| (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_LEFT); | |||
| (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_LEFT); | |||
| (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_LEFT); | |||
| } | |||
| else if (bufferBit == FRONT_RIGHT_BIT) { | |||
| (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT); | |||
| (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); | |||
| (*ctx->Driver.SetDrawBuffer)( ctx, GL_FRONT_RIGHT); | |||
| (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_FRONT_RIGHT); | |||
| } | |||
| else if (bufferBit == BACK_LEFT_BIT) { | |||
| (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT); | |||
| (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_LEFT); | |||
| (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_LEFT); | |||
| (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_LEFT); | |||
| } | |||
| else { | |||
| (void) (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT); | |||
| (void) (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_RIGHT); | |||
| (*ctx->Driver.SetDrawBuffer)( ctx, GL_BACK_RIGHT); | |||
| (*swrast->Driver.SetReadBuffer)( ctx, ctx->DrawBuffer, GL_BACK_RIGHT); | |||
| } | |||
| if (colorMask != 0xffffffff) { | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_context.c,v 1.33 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: s_context.c,v 1.34 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -28,6 +28,7 @@ | |||
| */ | |||
| #include "glheader.h" | |||
| #include "context.h" | |||
| #include "mtypes.h" | |||
| #include "mem.h" | |||
| @@ -86,10 +87,8 @@ _swrast_update_rasterflags( GLcontext *ctx ) | |||
| * MULTI_DRAW_BIT flag. Also set it if we're drawing to no | |||
| * buffers or the RGBA or CI mask disables all writes. | |||
| */ | |||
| if (ctx->Color.MultiDrawBuffer) { | |||
| RasterMask |= MULTI_DRAW_BIT; | |||
| } | |||
| else if (ctx->Color.DrawBuffer==GL_NONE) { | |||
| if (ctx->Color.DrawBuffer == GL_FRONT_AND_BACK || | |||
| ctx->Color.DrawBuffer == GL_NONE) { | |||
| RasterMask |= MULTI_DRAW_BIT; | |||
| } | |||
| else if (ctx->Visual.rgbMode && *((GLuint *) ctx->Color.ColorMask) == 0) { | |||
| @@ -389,7 +388,7 @@ _swrast_Quad( GLcontext *ctx, | |||
| const SWvertex *v2, const SWvertex *v3 ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_Quad\n"); | |||
| _mesa_debug(ctx, "_swrast_Quad\n"); | |||
| _swrast_print_vertex( ctx, v0 ); | |||
| _swrast_print_vertex( ctx, v1 ); | |||
| _swrast_print_vertex( ctx, v2 ); | |||
| @@ -404,7 +403,7 @@ _swrast_Triangle( GLcontext *ctx, const SWvertex *v0, | |||
| const SWvertex *v1, const SWvertex *v2 ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_Triangle\n"); | |||
| _mesa_debug(ctx, "_swrast_Triangle\n"); | |||
| _swrast_print_vertex( ctx, v0 ); | |||
| _swrast_print_vertex( ctx, v1 ); | |||
| _swrast_print_vertex( ctx, v2 ); | |||
| @@ -416,7 +415,7 @@ void | |||
| _swrast_Line( GLcontext *ctx, const SWvertex *v0, const SWvertex *v1 ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_Line\n"); | |||
| _mesa_debug(ctx, "_swrast_Line\n"); | |||
| _swrast_print_vertex( ctx, v0 ); | |||
| _swrast_print_vertex( ctx, v1 ); | |||
| } | |||
| @@ -427,7 +426,7 @@ void | |||
| _swrast_Point( GLcontext *ctx, const SWvertex *v0 ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_Point\n"); | |||
| _mesa_debug(ctx, "_swrast_Point\n"); | |||
| _swrast_print_vertex( ctx, v0 ); | |||
| } | |||
| SWRAST_CONTEXT(ctx)->Point( ctx, v0 ); | |||
| @@ -437,7 +436,7 @@ void | |||
| _swrast_InvalidateState( GLcontext *ctx, GLuint new_state ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_InvalidateState\n"); | |||
| _mesa_debug(ctx, "_swrast_InvalidateState\n"); | |||
| } | |||
| SWRAST_CONTEXT(ctx)->InvalidateState( ctx, new_state ); | |||
| } | |||
| @@ -446,7 +445,7 @@ void | |||
| _swrast_ResetLineStipple( GLcontext *ctx ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_ResetLineStipple\n"); | |||
| _mesa_debug(ctx, "_swrast_ResetLineStipple\n"); | |||
| } | |||
| SWRAST_CONTEXT(ctx)->StippleCounter = 0; | |||
| } | |||
| @@ -455,7 +454,7 @@ void | |||
| _swrast_allow_vertex_fog( GLcontext *ctx, GLboolean value ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_allow_vertex_fog %d\n", value); | |||
| _mesa_debug(ctx, "_swrast_allow_vertex_fog %d\n", value); | |||
| } | |||
| SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT ); | |||
| SWRAST_CONTEXT(ctx)->AllowVertexFog = value; | |||
| @@ -465,7 +464,7 @@ void | |||
| _swrast_allow_pixel_fog( GLcontext *ctx, GLboolean value ) | |||
| { | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_allow_pixel_fog %d\n", value); | |||
| _mesa_debug(ctx, "_swrast_allow_pixel_fog %d\n", value); | |||
| } | |||
| SWRAST_CONTEXT(ctx)->InvalidateState( ctx, _NEW_HINT ); | |||
| SWRAST_CONTEXT(ctx)->AllowPixelFog = value; | |||
| @@ -479,7 +478,7 @@ _swrast_CreateContext( GLcontext *ctx ) | |||
| SWcontext *swrast = (SWcontext *)CALLOC(sizeof(SWcontext)); | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_CreateContext\n"); | |||
| _mesa_debug(ctx, "_swrast_CreateContext\n"); | |||
| } | |||
| if (!swrast) | |||
| @@ -539,7 +538,7 @@ _swrast_DestroyContext( GLcontext *ctx ) | |||
| SWcontext *swrast = SWRAST_CONTEXT(ctx); | |||
| if (SWRAST_DEBUG) { | |||
| _mesa_debug("_swrast_DestroyContext\n"); | |||
| _mesa_debug(ctx, "_swrast_DestroyContext\n"); | |||
| } | |||
| FREE( swrast->span ); | |||
| @@ -565,32 +564,32 @@ _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ) | |||
| GLuint i; | |||
| if (SWRAST_DEBUG_VERTICES) { | |||
| _mesa_debug("win %f %f %f %f\n", | |||
| _mesa_debug(ctx, "win %f %f %f %f\n", | |||
| v->win[0], v->win[1], v->win[2], v->win[3]); | |||
| for (i = 0 ; i < ctx->Const.MaxTextureUnits ; i++) | |||
| if (ctx->Texture.Unit[i]._ReallyEnabled) | |||
| _mesa_debug("texcoord[%d] %f %f %f %f\n", i, | |||
| _mesa_debug(ctx, "texcoord[%d] %f %f %f %f\n", i, | |||
| v->texcoord[i][0], v->texcoord[i][1], | |||
| v->texcoord[i][2], v->texcoord[i][3]); | |||
| #if CHAN_TYPE == GL_FLOAT | |||
| _mesa_debug("color %f %f %f %f\n", | |||
| _mesa_debug(ctx, "color %f %f %f %f\n", | |||
| v->color[0], v->color[1], v->color[2], v->color[3]); | |||
| _mesa_debug("spec %f %f %f %f\n", | |||
| _mesa_debug(ctx, "spec %f %f %f %f\n", | |||
| v->specular[0], v->specular[1], | |||
| v->specular[2], v->specular[3]); | |||
| #else | |||
| _mesa_debug("color %d %d %d %d\n", | |||
| _mesa_debug(ctx, "color %d %d %d %d\n", | |||
| v->color[0], v->color[1], v->color[2], v->color[3]); | |||
| _mesa_debug("spec %d %d %d %d\n", | |||
| _mesa_debug(ctx, "spec %d %d %d %d\n", | |||
| v->specular[0], v->specular[1], | |||
| v->specular[2], v->specular[3]); | |||
| #endif | |||
| _mesa_debug("fog %f\n", v->fog); | |||
| _mesa_debug("index %d\n", v->index); | |||
| _mesa_debug("pointsize %f\n", v->pointSize); | |||
| _mesa_debug("\n"); | |||
| _mesa_debug(ctx, "fog %f\n", v->fog); | |||
| _mesa_debug(ctx, "index %d\n", v->index); | |||
| _mesa_debug(ctx, "pointsize %f\n", v->pointSize); | |||
| _mesa_debug(ctx, "\n"); | |||
| } | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_drawpix.c,v 1.33 2002/04/19 14:05:50 brianp Exp $ */ | |||
| /* $Id: s_drawpix.c,v 1.34 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -629,6 +629,8 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
| if (ctx->Fog.Enabled) | |||
| _mesa_span_default_fog(ctx, span); | |||
| if (ctx->Texture._ReallyEnabled) | |||
| _mesa_span_default_texcoords(ctx, span); | |||
| if (type==GL_UNSIGNED_SHORT && ctx->Visual.depthBits == 16 | |||
| && !bias_or_scale && !zoom && ctx->Visual.rgbMode) { | |||
| @@ -732,6 +734,8 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, | |||
| _mesa_span_default_z(ctx, span); | |||
| if (ctx->Fog.Enabled) | |||
| _mesa_span_default_fog(ctx, span); | |||
| if (ctx->Texture._ReallyEnabled) | |||
| _mesa_span_default_texcoords(ctx, span); | |||
| if (SWRAST_CONTEXT(ctx)->_RasterMask == 0 && !zoom && x >= 0 && y >= 0 | |||
| && x + width <= (GLint) ctx->DrawBuffer->Width | |||
| @@ -859,11 +863,11 @@ _swrast_DrawPixels( GLcontext *ctx, | |||
| SWcontext *swrast = SWRAST_CONTEXT(ctx); | |||
| (void) unpack; | |||
| if (swrast->NewState) | |||
| _swrast_validate_derived( ctx ); | |||
| RENDER_START(swrast,ctx); | |||
| switch (format) { | |||
| case GL_STENCIL_INDEX: | |||
| draw_stencil_pixels( ctx, x, y, width, height, type, pixels ); | |||
| @@ -896,3 +900,55 @@ _swrast_DrawPixels( GLcontext *ctx, | |||
| RENDER_FINISH(swrast,ctx); | |||
| } | |||
| #if 0 /* experimental */ | |||
| /* | |||
| * Execute glDrawDepthPixelsMESA(). | |||
| */ | |||
| void | |||
| _swrast_DrawDepthPixelsMESA( GLcontext *ctx, | |||
| GLint x, GLint y, | |||
| GLsizei width, GLsizei height, | |||
| GLenum colorFormat, GLenum colorType, | |||
| const GLvoid *colors, | |||
| GLenum depthType, const GLvoid *depths, | |||
| const struct gl_pixelstore_attrib *unpack ) | |||
| { | |||
| SWcontext *swrast = SWRAST_CONTEXT(ctx); | |||
| (void) unpack; | |||
| if (swrast->NewState) | |||
| _swrast_validate_derived( ctx ); | |||
| RENDER_START(swrast,ctx); | |||
| switch (colorFormat) { | |||
| case GL_COLOR_INDEX: | |||
| if (ctx->Visual.rgbMode) | |||
| draw_rgba_pixels(ctx, x,y, width, height, colorFormat, colorType, colors); | |||
| else | |||
| draw_index_pixels(ctx, x, y, width, height, colorType, colors); | |||
| break; | |||
| case GL_RED: | |||
| case GL_GREEN: | |||
| case GL_BLUE: | |||
| case GL_ALPHA: | |||
| case GL_LUMINANCE: | |||
| case GL_LUMINANCE_ALPHA: | |||
| case GL_RGB: | |||
| case GL_BGR: | |||
| case GL_RGBA: | |||
| case GL_BGRA: | |||
| case GL_ABGR_EXT: | |||
| draw_rgba_pixels(ctx, x, y, width, height, colorFormat, colorType, colors); | |||
| break; | |||
| default: | |||
| _mesa_error( ctx, GL_INVALID_ENUM, | |||
| "glDrawDepthPixelsMESA(colorFormat)" ); | |||
| } | |||
| RENDER_FINISH(swrast,ctx); | |||
| } | |||
| #endif | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_span.c,v 1.42 2002/05/02 00:59:20 brianp Exp $ */ | |||
| /* $Id: s_span.c,v 1.43 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -119,6 +119,28 @@ _mesa_span_default_color( GLcontext *ctx, struct sw_span *span ) | |||
| } | |||
| /** | |||
| * Init span's texcoord interpolation values to the RasterPos texcoords. | |||
| * Used during setup for glDraw/CopyPixels. | |||
| */ | |||
| void | |||
| _mesa_span_default_texcoords( GLcontext *ctx, struct sw_span *span ) | |||
| { | |||
| GLuint i; | |||
| for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { | |||
| span->tex[i][0] = ctx->Current.RasterTexCoords[i][0]; | |||
| span->tex[i][1] = ctx->Current.RasterTexCoords[i][1]; | |||
| span->tex[i][2] = ctx->Current.RasterTexCoords[i][2]; | |||
| span->tex[i][3] = ctx->Current.RasterTexCoords[i][3]; | |||
| span->texStepX[i][0] = 0.0; | |||
| span->texStepX[i][1] = 0.0; | |||
| span->texStepX[i][2] = 0.0; | |||
| span->texStepX[i][3] = 0.0; | |||
| } | |||
| span->interpMask |= SPAN_TEXTURE; | |||
| } | |||
| /* Fill in the span.color.rgba array from the interpolation values */ | |||
| static void | |||
| interpolate_colors(GLcontext *ctx, struct sw_span *span) | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: s_span.h,v 1.16 2002/04/12 15:39:59 brianp Exp $ */ | |||
| /* $Id: s_span.h,v 1.17 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -45,6 +45,8 @@ _mesa_span_default_fog( GLcontext *ctx, struct sw_span *span ); | |||
| extern void | |||
| _mesa_span_default_color( GLcontext *ctx, struct sw_span *span ); | |||
| extern void | |||
| _mesa_span_default_texcoords( GLcontext *ctx, struct sw_span *span ); | |||
| extern void | |||
| _mesa_write_index_span( GLcontext *ctx, struct sw_span *span); | |||
| @@ -1,10 +1,10 @@ | |||
| /* $Id: ss_vb.c,v 1.17 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: ss_vb.c,v 1.18 2002/06/15 02:38:17 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| * Version: 3.5 | |||
| * Version: 4.1 | |||
| * | |||
| * Copyright (C) 1999-2001 Brian Paul All Rights Reserved. | |||
| * Copyright (C) 1999-2002 Brian Paul All Rights Reserved. | |||
| * | |||
| * Permission is hereby granted, free of charge, to any person obtaining a | |||
| * copy of this software and associated documentation files (the "Software"), | |||
| @@ -29,6 +29,7 @@ | |||
| #include "glheader.h" | |||
| #include "colormac.h" | |||
| #include "context.h" | |||
| #include "macros.h" | |||
| #include "mem.h" | |||
| @@ -291,33 +292,32 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) | |||
| * Initialization | |||
| ***********************************************************************/ | |||
| static void | |||
| emit_invalid( GLcontext *ctx, GLuint start, GLuint end, GLuint newinputs ) | |||
| { | |||
| _mesa_debug("swrast_setup: invalid setup function\n"); | |||
| _mesa_debug(ctx, "swrast_setup: invalid setup function\n"); | |||
| (void) (ctx && start && end && newinputs); | |||
| } | |||
| static void | |||
| interp_invalid( GLcontext *ctx, GLfloat t, | |||
| GLuint edst, GLuint eout, GLuint ein, | |||
| GLboolean force_boundary ) | |||
| { | |||
| _mesa_debug("swrast_setup: invalid interp function\n"); | |||
| _mesa_debug(ctx, "swrast_setup: invalid interp function\n"); | |||
| (void) (ctx && t && edst && eout && ein && force_boundary); | |||
| } | |||
| static void | |||
| copy_pv_invalid( GLcontext *ctx, GLuint edst, GLuint esrc ) | |||
| { | |||
| _mesa_debug("swrast_setup: invalid copy_pv function\n"); | |||
| _mesa_debug(ctx, "swrast_setup: invalid copy_pv function\n"); | |||
| (void) (ctx && edst && esrc ); | |||
| } | |||
| static void init_standard( void ) | |||
| { | |||
| GLuint i; | |||
| @@ -359,22 +359,24 @@ static void init_standard( void ) | |||
| init_index_fog_point(); | |||
| } | |||
| static void printSetupFlags(char *msg, GLuint flags ) | |||
| /* debug only */ | |||
| static void | |||
| printSetupFlags(const GLcontext *ctx, char *msg, GLuint flags ) | |||
| { | |||
| _mesa_debug("%s(%x): %s%s%s%s%s%s%s\n", | |||
| msg, | |||
| (int)flags, | |||
| (flags & COLOR) ? "color, " : "", | |||
| (flags & INDEX) ? "index, " : "", | |||
| (flags & TEX0) ? "tex0, " : "", | |||
| (flags & MULTITEX) ? "multitex, " : "", | |||
| (flags & SPEC) ? "spec, " : "", | |||
| (flags & FOG) ? "fog, " : "", | |||
| (flags & POINT) ? "point, " : ""); | |||
| _mesa_debug(ctx, "%s(%x): %s%s%s%s%s%s%s\n", | |||
| msg, | |||
| (int) flags, | |||
| (flags & COLOR) ? "color, " : "", | |||
| (flags & INDEX) ? "index, " : "", | |||
| (flags & TEX0) ? "tex0, " : "", | |||
| (flags & MULTITEX) ? "multitex, " : "", | |||
| (flags & SPEC) ? "spec, " : "", | |||
| (flags & FOG) ? "fog, " : "", | |||
| (flags & POINT) ? "point, " : ""); | |||
| } | |||
| void | |||
| _swsetup_choose_rastersetup_func(GLcontext *ctx) | |||
| { | |||
| @@ -436,6 +438,8 @@ _swsetup_vb_init( GLcontext *ctx ) | |||
| { | |||
| (void) ctx; | |||
| init_standard(); | |||
| (void) printSetupFlags; | |||
| /* | |||
| printSetupFlags(ctx); | |||
| */ | |||
| } | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: t_imm_api.c,v 1.28 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: t_imm_api.c,v 1.29 2002/06/15 02:38:18 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -60,7 +60,7 @@ void _tnl_flush_immediate( GLcontext *ctx, struct immediate *IM ) | |||
| } | |||
| if (MESA_VERBOSE & VERBOSE_IMMEDIATE) | |||
| _mesa_debug("_tnl_flush_immediate IM: %d compiling: %d\n", | |||
| _mesa_debug(ctx, "_tnl_flush_immediate IM: %d compiling: %d\n", | |||
| IM->id, ctx->CompileFlag); | |||
| if (IM->FlushElt == FLUSH_ELT_EAGER) { | |||
| @@ -86,12 +86,15 @@ void _tnl_flush_vertices( GLcontext *ctx, GLuint flags ) | |||
| struct immediate *IM = TNL_CURRENT_IM(ctx); | |||
| if (MESA_VERBOSE & VERBOSE_IMMEDIATE) | |||
| _mesa_debug("_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n", | |||
| _mesa_debug(ctx, | |||
| "_tnl_flush_vertices flags %x IM(%d) %d..%d Flag[%d]: %x\n", | |||
| flags, IM->id, IM->Start, IM->Count, IM->Start, | |||
| IM->Flag[IM->Start]); | |||
| if (IM->Flag[IM->Start]) | |||
| if ((flags & FLUSH_UPDATE_CURRENT) || IM->Count > IM->Start) | |||
| if ((flags & FLUSH_UPDATE_CURRENT) || | |||
| IM->Count > IM->Start || | |||
| (IM->Flag[IM->Start] & (VERT_BEGIN|VERT_END))) | |||
| _tnl_flush_immediate( ctx, IM ); | |||
| } | |||
| @@ -105,7 +108,7 @@ _tnl_save_Begin( GLenum mode ) | |||
| struct immediate *IM = TNL_CURRENT_IM(ctx); | |||
| GLuint inflags, state; | |||
| /* _mesa_debug("%s: before: %x\n", __FUNCTION__, IM->BeginState); */ | |||
| /* _mesa_debug(ctx, "%s: before: %x\n", __FUNCTION__, IM->BeginState); */ | |||
| if (mode > GL_POLYGON) { | |||
| _mesa_compile_error( ctx, GL_INVALID_ENUM, "_tnl_Begin" ); | |||
| @@ -115,12 +118,14 @@ _tnl_save_Begin( GLenum mode ) | |||
| if (ctx->NewState) | |||
| _mesa_update_state(ctx); | |||
| #if 000 | |||
| /* if only a very few slots left, might as well flush now | |||
| */ | |||
| if (IM->Count > IMM_MAXDATA-8) { | |||
| _tnl_flush_immediate( ctx, IM ); | |||
| IM = TNL_CURRENT_IM(ctx); | |||
| } | |||
| #endif | |||
| /* Check for and flush buffered vertices from internal operations. | |||
| */ | |||
| @@ -158,16 +163,9 @@ _tnl_save_Begin( GLenum mode ) | |||
| ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; | |||
| IM->BeginState = state; | |||
| if (ctx->ExecuteFlag) { | |||
| if (ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { | |||
| _mesa_error( ctx, GL_INVALID_OPERATION, "_tnl_Begin" ); | |||
| } | |||
| else | |||
| ctx->Driver.CurrentExecPrimitive = mode; | |||
| } | |||
| /* Update save_primitive now. | |||
| /* Update save_primitive now. Don't touch ExecPrimitive as this is | |||
| * updated in the replay of this cassette if we are in | |||
| * COMPILE_AND_EXECUTE mode. | |||
| */ | |||
| if (ctx->Driver.CurrentSavePrimitive == PRIM_UNKNOWN) | |||
| ctx->Driver.CurrentSavePrimitive = PRIM_INSIDE_UNKNOWN_PRIM; | |||
| @@ -203,8 +201,9 @@ _tnl_Begin( GLenum mode ) | |||
| if (IM->Start == IM->Count && | |||
| tnl->Driver.NotifyBegin && | |||
| tnl->Driver.NotifyBegin( ctx, mode )) | |||
| tnl->Driver.NotifyBegin( ctx, mode )) { | |||
| return; | |||
| } | |||
| assert( IM->SavedBeginState == 0 ); | |||
| assert( IM->BeginState == 0 ); | |||
| @@ -223,7 +222,7 @@ _tnl_Begin( GLenum mode ) | |||
| IM->LastPrimitive = count; | |||
| IM->BeginState = (VERT_BEGIN_0|VERT_BEGIN_1); | |||
| /* _mesa_debug("%s: %x\n", __FUNCTION__, IM->BeginState); */ | |||
| /* _mesa_debug(ctx, "%s: %x\n", __FUNCTION__, IM->BeginState); */ | |||
| ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES; | |||
| ctx->Driver.CurrentExecPrimitive = mode; | |||
| @@ -238,12 +237,12 @@ _tnl_Begin( GLenum mode ) | |||
| GLboolean | |||
| _tnl_hard_begin( GLcontext *ctx, GLenum p ) | |||
| { | |||
| /* _mesa_debug("%s\n", __FUNCTION__); */ | |||
| /* _mesa_debug(ctx, "%s\n", __FUNCTION__); */ | |||
| if (!ctx->CompileFlag) { | |||
| /* If not compiling, treat as a normal begin(). | |||
| */ | |||
| /* _mesa_debug("%s: treating as glBegin\n", __FUNCTION__); */ | |||
| /* _mesa_debug(ctx, "%s: treating as glBegin\n", __FUNCTION__); */ | |||
| glBegin( p ); | |||
| return GL_TRUE; | |||
| } | |||
| @@ -358,7 +357,7 @@ _tnl_end( GLcontext *ctx ) | |||
| IM->BeginState = state; | |||
| if (ctx->ExecuteFlag) { | |||
| if (!ctx->CompileFlag) { | |||
| if (ctx->Driver.CurrentExecPrimitive == PRIM_OUTSIDE_BEGIN_END) | |||
| _mesa_error( ctx, GL_INVALID_OPERATION, "_tnl_End" ); | |||
| else | |||
| @@ -368,8 +367,7 @@ _tnl_end( GLcontext *ctx ) | |||
| /* You can set this flag to get the old 'flush_vb on glEnd()' | |||
| * behaviour. | |||
| */ | |||
| /* XXXX tempory change here */ | |||
| if (1 /*(MESA_DEBUG_FLAGS&DEBUG_ALWAYS_FLUSH)*/ ) | |||
| if (MESA_DEBUG_FLAGS & DEBUG_ALWAYS_FLUSH) | |||
| _tnl_flush_immediate( ctx, IM ); | |||
| } | |||
| @@ -1205,7 +1203,7 @@ _tnl_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) | |||
| return; | |||
| if (MESA_VERBOSE & VERBOSE_API) | |||
| _mesa_debug("_tnl_Materialfv\n"); | |||
| _mesa_debug(ctx, "_tnl_Materialfv\n"); | |||
| if (tnl->IsolateMaterials && | |||
| !(IM->BeginState & VERT_BEGIN_1)) /* heuristic */ | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: t_imm_dlist.c,v 1.41 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: t_imm_dlist.c,v 1.42 2002/06/15 02:38:18 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -129,7 +129,7 @@ _tnl_compile_cassette( GLcontext *ctx, struct immediate *IM ) | |||
| GLuint new_beginstate; | |||
| if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) | |||
| _mesa_debug("_tnl_compiled_cassette IM: %d\n", IM->id); | |||
| _mesa_debug(ctx, "_tnl_compiled_cassette IM: %d\n", IM->id); | |||
| if (IM->FlushElt) { | |||
| ASSERT (IM->FlushElt == FLUSH_ELT_LAZY); | |||
| @@ -317,7 +317,7 @@ execute_compiled_cassette( GLcontext *ctx, void *data ) | |||
| _tnl_print_cassette( IM ); | |||
| if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST) { | |||
| _mesa_debug("Run cassette %d, rows %d..%d, beginstate %x ", | |||
| _mesa_debug(ctx, "Run cassette %d, rows %d..%d, beginstate %x ", | |||
| IM->id, IM->Start, IM->Count, IM->BeginState); | |||
| _tnl_print_vert_flags("orflag", IM->OrFlag); | |||
| } | |||
| @@ -400,7 +400,7 @@ print_compiled_cassette( GLcontext *ctx, void *data ) | |||
| TNLvertexcassette *node = (TNLvertexcassette *)data; | |||
| struct immediate *IM = node->IM; | |||
| _mesa_debug("TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n", | |||
| _mesa_debug(ctx, "TNL-VERTEX-CASSETTE, id %u, rows %u..%u\n", | |||
| node->IM->id, node->Start, node->Count); | |||
| IM->Start = node->Start; | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: t_imm_elt.c,v 1.17 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: t_imm_elt.c,v 1.18 2002/06/15 02:38:18 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -758,8 +758,8 @@ void _tnl_translate_array_elts( GLcontext *ctx, struct immediate *IM, | |||
| GLuint translate = ctx->Array._Enabled; | |||
| GLuint i; | |||
| if (MESA_VERBOSE&VERBOSE_IMMEDIATE) | |||
| _mesa_debug("exec_array_elements %d .. %d\n", start, count); | |||
| if (MESA_VERBOSE & VERBOSE_IMMEDIATE) | |||
| _mesa_debug(ctx, "exec_array_elements %d .. %d\n", start, count); | |||
| if (translate & VERT_BIT_POS) { | |||
| _tnl_trans_elt_4f( IM->Attrib[VERT_ATTRIB_POS], | |||
| @@ -1,4 +1,4 @@ | |||
| /* $Id: t_imm_exec.c,v 1.40 2002/06/13 04:49:17 brianp Exp $ */ | |||
| /* $Id: t_imm_exec.c,v 1.41 2002/06/15 02:38:18 brianp Exp $ */ | |||
| /* | |||
| * Mesa 3-D graphics library | |||
| @@ -72,7 +72,7 @@ static void reset_input( GLcontext *ctx, | |||
| MEMSET(IM->Flag + start, 0, sizeof(GLuint) * (IM->Count+2-start)); | |||
| if (MESA_VERBOSE & VERBOSE_IMMEDIATE) | |||
| _mesa_debug("reset_input: IM(%d) new %x\n", IM->id, beginstate); | |||
| _mesa_debug(ctx, "reset_input: IM(%d) new %x\n", IM->id, beginstate); | |||
| IM->Start = start; | |||
| IM->Count = start; | |||