diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2000-11-24 10:25:05 +0000 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2000-11-24 10:25:05 +0000 |
commit | ad2ac216fa0cbebc36530bf9e5256e902710b892 (patch) | |
tree | 2b44b0129679558d0a1760bf94d75bcdbfe145ad /src/mesa/drivers/glide | |
parent | 00608a79dce1ea5e274f35b0a1883f7b623b9d7a (diff) |
Support for swappable t&l modules, including an example one in the FX
driver (enable with FX_ALLOW_VTXFMT=t).
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 106 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxddspan.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 7 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdrv.h | 237 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxglidew.c | 1 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxsetup.c | 30 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxtexman.c | 1 |
7 files changed, 213 insertions, 170 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index fc375f054f..c7229561d7 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -710,13 +710,11 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa ) fxMesa->currentFB=GR_BUFFER_FRONTBUFFER; FX_grRenderBuffer(GR_BUFFER_FRONTBUFFER); } - - fxMesa->state = NULL; - fxMesa->fogTable = NULL; - - fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE)); - fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES)*sizeof(GrFog_t)); - + + fxMesa->state = malloc(FX_grGetInteger(FX_GLIDE_STATE_SIZE)); + fxMesa->fogTable = malloc(FX_grGetInteger(FX_FOG_TABLE_ENTRIES) * + sizeof(GrFog_t)); + if (!fxMesa->state || !fxMesa->fogTable) { if (fxMesa->state) free(fxMesa->state); if (fxMesa->fogTable) free(fxMesa->fogTable); @@ -756,7 +754,8 @@ int fxDDInitFxMesaContext( fxMesaContext fxMesa ) _swrast_allow_vertex_fog( fxMesa->glCtx, GL_FALSE ); _swrast_allow_pixel_fog( fxMesa->glCtx, GL_TRUE ); - fxDDInitExtensions(fxMesa->glCtx); + fxDDInitExtensions(fxMesa->glCtx); + fxDDInitVtxfmt(fxMesa->glCtx); FX_grGlideGetState((GrState*)fxMesa->state); @@ -902,41 +901,75 @@ static GLboolean fxIsInHardware(GLcontext *ctx) return GL_TRUE; } +static void update_texture_scales( GLcontext *ctx ) +{ + fxMesaContext fxMesa = FX_CONTEXT(ctx); + struct gl_texture_unit *t0 = &ctx->Texture.Unit[fxMesa->tmu_source[0]]; + struct gl_texture_unit *t1 = &ctx->Texture.Unit[fxMesa->tmu_source[1]]; + + if (t0 && t0->_Current && FX_TEXTURE_DATA(t0)) { + fxMesa->s0scale = FX_TEXTURE_DATA(t0)->sScale; + fxMesa->t0scale = FX_TEXTURE_DATA(t0)->tScale; + fxMesa->inv_s0scale = 1.0 / fxMesa->s0scale; + fxMesa->inv_t0scale = 1.0 / fxMesa->t0scale; + } + + if (t1 && t1->_Current && FX_TEXTURE_DATA(t1)) { + fxMesa->s1scale = FX_TEXTURE_DATA(t1)->sScale; + fxMesa->t1scale = FX_TEXTURE_DATA(t1)->tScale; + fxMesa->inv_s1scale = 1.0 / fxMesa->s1scale; + fxMesa->inv_t1scale = 1.0 / fxMesa->t1scale; + } +} static void fxDDUpdateDDPointers(GLcontext *ctx) { - GLuint new_state = ctx->NewState; + fxMesaContext fxMesa = FX_CONTEXT(ctx); + GLuint new_state = ctx->NewState; - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); + _swrast_InvalidateState( ctx, new_state ); + _swsetup_InvalidateState( ctx, new_state ); + _tnl_InvalidateState( ctx, new_state ); - /* Recalculate fog table on projection matrix changes. This used to - * be triggered by the NearFar callback. - */ - if (new_state & _NEW_PROJECTION) { - FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG; - ctx->Driver.RenderStart = fxSetupFXUnits; - } - - if (new_state & (_FX_NEW_IS_IN_HARDWARE | - _FX_NEW_RENDERSTATE | - _FX_NEW_SETUP_FUNCTION)) - { - fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; - - if (new_state & _FX_NEW_IS_IN_HARDWARE) - fxMesa->is_in_hardware = fxIsInHardware(ctx); + /* Recalculate fog table on projection matrix changes. This used to + * be triggered by the NearFar callback. + */ + if (new_state & _NEW_PROJECTION) + fxMesa->new_state |= FX_NEW_FOG; + + if (new_state & (_FX_NEW_IS_IN_HARDWARE | + _FX_NEW_RENDERSTATE | + _FX_NEW_SETUP_FUNCTION | + _NEW_TEXTURE)) + { + fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; + + if (new_state & _FX_NEW_IS_IN_HARDWARE) + fxMesa->is_in_hardware = fxIsInHardware(ctx); + + if (fxMesa->new_state) + fxSetupFXUnits(ctx); + + if (new_state & _FX_NEW_RENDERSTATE) + fxDDChooseRenderState( ctx ); + + if (new_state & _FX_NEW_SETUP_FUNCTION) + ctx->Driver.RasterSetup = fxDDChooseSetupFunction(ctx); + + if (new_state & _NEW_TEXTURE) + update_texture_scales( ctx ); - if (fxMesa->new_state) - fxSetupFXUnits(ctx); + } - if (new_state & _FX_NEW_RENDERSTATE) - fxDDChooseRenderState( ctx ); + if (fxMesa->allow_vfmt) { + if (new_state & _NEW_LIGHT) + fx_update_lighting( ctx ); - if (new_state & _FX_NEW_SETUP_FUNCTION) - ctx->Driver.RasterSetup = fxDDChooseSetupFunction(ctx); - } + if (new_state & _FX_NEW_VTXFMT) + fxDDCheckVtxfmt( ctx ); + else if (fxMesa->vtxfmt_fallback_count > 1) + fxMesa->vtxfmt_fallback_count--; + } } @@ -971,7 +1004,7 @@ void fxSetupDDPointers(GLcontext *ctx) ctx->Driver.Finish=fxDDFinish; ctx->Driver.Flush=NULL; - ctx->Driver.RenderStart=NULL; + ctx->Driver.RenderStart=fxSetupFXUnits; ctx->Driver.RenderFinish=_swrast_flush; ctx->Driver.TexImage2D = fxDDTexImage2D; @@ -1013,6 +1046,7 @@ void fxSetupDDPointers(GLcontext *ctx) * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_dd(void); int gl_fx_dummy_function_dd(void) { return 0; diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index 7eb8591ae6..fceeb0e60a 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -565,6 +565,7 @@ void fxSetupDDSpanPointers(GLcontext *ctx) * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_span(void); int gl_fx_dummy_function_span(void) { return 0; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 85d2271b72..f7beaf7e34 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -99,7 +99,6 @@ static void fxTexInvalidate(GLcontext *ctx, struct gl_texture_object *tObj) ti->validated=GL_FALSE; fxMesa->new_state|=FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; } static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa) @@ -159,7 +158,6 @@ void fxDDTexBind(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj) ti->lastTimeUsed=fxMesa->texBindNumber; fxMesa->new_state|=FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; } void fxDDTexEnv(GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *param) @@ -184,7 +182,6 @@ void fxDDTexEnv(GLcontext *ctx, GLenum target, GLenum pname, const GLfloat *para } fxMesa->new_state|=FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; } void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, @@ -282,7 +279,6 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, break; } fxMesa->new_state|=FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; break; case GL_TEXTURE_WRAP_T: @@ -297,7 +293,6 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, break; } fxMesa->new_state|=FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; break; case GL_TEXTURE_BORDER_COLOR: @@ -439,7 +434,6 @@ void fxDDTexPalette(GLcontext *ctx, struct gl_texture_object *tObj) } convertPalette(fxMesa->glbPalette.data, &ctx->Texture.Palette); fxMesa->new_state |= FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; } } @@ -1191,6 +1185,7 @@ GLvoid *fxDDGetTexImage(GLcontext *ctx, GLenum target, GLint level, * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_ddtex(void); int gl_fx_dummy_function_ddtex(void) { return 0; diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index f708a279b9..4c84475488 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -68,18 +68,6 @@ #include "math/m_vector.h" -/* use gl/gl.h GLAPI/GLAPIENTRY/GLCALLBACK in place of - * WINGDIAPI/APIENTRY/CALLBACK, these are defined in mesa gl/gl.h - - * tjump@spgs.com - */ - - - -extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * ); -#if defined(MESA_DEBUG) && 0 -#define grDrawTriangle fx_sanity_triangle -#endif - /* Define some shorter names for these things. */ @@ -99,18 +87,6 @@ extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * ); #define T1COORD GR_VERTEX_TOW_TMU1_OFFSET - -#define CLIP_XCOORD 0 /* normal place */ -#define CLIP_YCOROD 1 /* normal place */ -#define CLIP_ZCOORD 2 /* GR_VERTEX_Z_OFFSET */ -#define CLIP_WCOORD 3 /* GR_VERTEX_R_OFFSET */ -#define CLIP_GCOORD 4 /* normal place */ -#define CLIP_BCOORD 5 /* normal place */ -#define CLIP_RCOORD 6 /* GR_VERTEX_OOZ_OFFSET */ -#define CLIP_ACOORD 7 /* normal place */ - - - /* Should have size == 16 * sizeof(float). */ typedef union { @@ -119,6 +95,26 @@ typedef union { GLuint ui[16]; } fxVertex; +/* Used in the fxvtxfmt t&l engine. + */ +typedef struct { + GrVertex v; + GLfloat clip[4]; + GLfloat win[4]; + GLfloat texcoord[2][2]; + GLubyte mask; + GLfloat normal[3]; /* for replay & fallback */ +} fxClipVertex; + + + +typedef void (*vfmt_project_func)( GLcontext *ctx, fxClipVertex *v ); +typedef void (*vfmt_interpolate_func)( GLfloat t, + fxClipVertex *O, + const fxClipVertex *I, + const fxClipVertex *J ); + + #if defined(FXMESA_USE_ARGB) #define FXCOLOR4( c ) ( \ @@ -141,16 +137,14 @@ typedef union { -/* Mergable items first +/* fastpath/vtxfmt flags first */ -#define SETUP_RGBA 0x1 -#define SETUP_TMU0 0x2 -#define SETUP_TMU1 0x4 +#define SETUP_TMU0 0x1 +#define SETUP_TMU1 0x2 +#define SETUP_RGBA 0x4 #define SETUP_XYZW 0x8 #define MAX_SETUP 0x10 -#define MAX_MERGABLE 0x8 - #define FX_NUM_TMU 2 @@ -199,7 +193,6 @@ typedef union { #define FX_UM_ALPHA_ITERATED 0x04000000 #define FX_UM_ALPHA_CONSTANT 0x08000000 -typedef void (*tfxRenderVBFunc)(GLcontext *); /* Memory range from startAddr to endAddr-1 @@ -355,6 +348,15 @@ struct tfxMesaVertexBuffer { _NEW_COLOR) \ +/* Covers the state referenced in fxDDCheckVtxfmt. + */ +#define _FX_NEW_VTXFMT (_NEW_TEXTURE | \ + _NEW_TEXTURE_MATRIX | \ + _NEW_TRANSFORM | \ + _NEW_LIGHT | \ + _FX_NEW_RENDERSTATE) + + /* These lookup table are used to extract RGB values in [0,255] from * 16-bit pixel values. */ @@ -369,101 +371,127 @@ typedef void (*fx_point_func)( GLcontext *, const fxVertex * ); typedef void (*fxRenderEltsFunc)( struct vertex_buffer * ); struct tfxMesaContext { - GuTexPalette glbPalette; + GuTexPalette glbPalette; - GLcontext *glCtx; /* the core Mesa context */ - GLvisual *glVis; /* describes the color buffer */ - GLframebuffer *glBuffer; /* the ancillary buffers */ + GLcontext *glCtx; /* the core Mesa context */ + GLvisual *glVis; /* describes the color buffer */ + GLframebuffer *glBuffer; /* the ancillary buffers */ - GLint board; /* the board used for this context */ - GLint width, height; /* size of color buffer */ + GLint board; /* the board used for this context */ + GLint width, height; /* size of color buffer */ - GrBuffer_t currentFB; + GrBuffer_t currentFB; - GLboolean bgrOrder; - GrColor_t color; - GrColor_t clearC; - GrAlpha_t clearA; - GLuint constColor; - GrCullMode_t cullMode; + GLboolean bgrOrder; + GrColor_t color; + GrColor_t clearC; + GrAlpha_t clearA; + GLuint constColor; + GrCullMode_t cullMode; - tfxUnitsState unitsState; - tfxUnitsState restoreUnitsState; /* saved during multipass */ + tfxUnitsState unitsState; + tfxUnitsState restoreUnitsState; /* saved during multipass */ - GLuint tmu_source[FX_NUM_TMU]; - GLuint tex_dest[MAX_TEXTURE_UNITS]; - GLuint render_index; - GLuint setupindex; - GLuint setupdone; - GLuint stw_hint_state; /* for grHints */ - GLuint is_in_hardware; - GLuint new_state; - GLuint using_fast_path, passes, multipass; + GLuint tmu_source[FX_NUM_TMU]; + GLuint tex_dest[MAX_TEXTURE_UNITS]; + GLuint render_index; + GLuint setupindex; + GLuint setupdone; + GLuint stw_hint_state; /* for grHints */ + GLuint is_in_hardware; + GLuint new_state; + GLuint using_fast_path, passes, multipass; - /* Texture Memory Manager Data */ + /* Texture Memory Manager Data */ - GLuint texBindNumber; - GLint tmuSrc; - GLuint lastUnitsMode; - GLuint freeTexMem[FX_NUM_TMU]; - MemRange *tmPool; - MemRange *tmFree[FX_NUM_TMU]; + GLuint texBindNumber; + GLint tmuSrc; + GLuint lastUnitsMode; + GLuint freeTexMem[FX_NUM_TMU]; + MemRange *tmPool; + MemRange *tmFree[FX_NUM_TMU]; - GLenum fogTableMode; - GLfloat fogDensity; - GLfloat fogStart, fogEnd; - GrFog_t *fogTable; - GLint textureAlign; + GLenum fogTableMode; + GLfloat fogDensity; + GLfloat fogStart, fogEnd; + GrFog_t *fogTable; + GLint textureAlign; - /* Acc. functions */ + /* Acc. functions */ - fx_point_func draw_point; - fx_line_func draw_line; - fx_tri_func draw_tri; + fx_point_func draw_point; + fx_line_func draw_line; + fx_tri_func draw_tri; - fxRenderEltsFunc RenderElementsRaw; + fxRenderEltsFunc RenderElementsRaw; /* System to turn culling on/off for tris/lines/points. */ - fx_point_func initial_point; - fx_line_func initial_line; - fx_tri_func initial_tri; + fx_point_func initial_point; + fx_line_func initial_line; + fx_tri_func initial_tri; - fx_point_func subsequent_point; - fx_line_func subsequent_line; - fx_tri_func subsequent_tri; + fx_point_func subsequent_point; + fx_line_func subsequent_line; + fx_tri_func subsequent_tri; + GLfloat s0scale; + GLfloat s1scale; + GLfloat t0scale; + GLfloat t1scale; GLfloat inv_s0scale; GLfloat inv_s1scale; GLfloat inv_t0scale; GLfloat inv_t1scale; - tfxStats stats; - - void *state; - - /* Options */ - - GLboolean verbose; - GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */ - GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */ - GLboolean haveAlphaBuffer; - GLboolean haveZBuffer; - GLboolean haveDoubleBuffer; - GLboolean haveGlobalPaletteTexture; - GLint swapInterval; - GLint maxPendingSwapBuffers; - - FX_GrContext_t glideContext; - - int screen_width; - int screen_height; - int initDone; - int clipMinX; - int clipMaxX; - int clipMinY; - int clipMaxY; + tfxStats stats; + + void *state; + + /* Options */ + + GLboolean verbose; + GLboolean haveTwoTMUs; /* True if we really have 2 tmu's */ + GLboolean emulateTwoTMUs; /* True if we present 2 tmu's to mesa. */ + GLboolean haveAlphaBuffer; + GLboolean haveZBuffer; + GLboolean haveDoubleBuffer; + GLboolean haveGlobalPaletteTexture; + GLint swapInterval; + GLint maxPendingSwapBuffers; + + FX_GrContext_t glideContext; + + int screen_width; + int screen_height; + int initDone; + int clipMinX; + int clipMaxX; + int clipMinY; + int clipMaxY; + + /* fxvtxfmt + */ + GLboolean allow_vfmt; + GLvertexformat vtxfmt; + fxClipVertex current; + fxClipVertex verts[4]; + fxClipVertex *vert; /* points into verts[] */ + void (*fire_on_vertex)( GLcontext * ); + void (*fire_on_end)( GLcontext * ); + void (*fire_on_fallback)( GLcontext * ); + + vfmt_project_func project_vertex; + vfmt_interpolate_func interpolate_vertices; + + int vtxfmt_fallback_count; + int vtxfmt_installed; + void (*old_begin)( GLenum ); + GLenum prim; + + GLuint accel_light; + GLfloat basecolor[4]; }; typedef void (*tfxSetupFunc)(struct vertex_buffer *, GLuint, GLuint); @@ -594,4 +622,7 @@ extern void fxTMMoveInTM_NoLock(fxMesaContext fxMesa, GLint where); extern void fxInitPixelTables(fxMesaContext fxMesa, GLboolean bgrOrder); +extern void fxDDCheckVtxfmt( GLcontext *ctx ); +extern void fx_update_lighting( GLcontext *ctx ); + #endif diff --git a/src/mesa/drivers/glide/fxglidew.c b/src/mesa/drivers/glide/fxglidew.c index ba345fcf33..400f1fbafc 100644 --- a/src/mesa/drivers/glide/fxglidew.c +++ b/src/mesa/drivers/glide/fxglidew.c @@ -436,6 +436,7 @@ FX_GrContext_t FX_grSstWinOpen( FxU32 hWnd, * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_glidew(void); int gl_fx_dummy_function_glidew(void) { return 0; diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index a5af36ca41..f4fde1214e 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -69,7 +69,7 @@ static void fxSetupBlend(GLcontext *ctx); static void fxSetupDepthTest(GLcontext *ctx); static void fxSetupScissor(GLcontext *ctx); static void fxSetupCull(GLcontext *ctx); -static void gl_print_fx_state_flags( const char *msg, GLuint flags); +static void fx_print_state_flags( const char *msg, GLuint flags); /*static GLboolean fxMultipassBlend(struct vertex_buffer *, GLuint);*/ static GLboolean fxMultipassTexture( struct vertex_buffer *, GLuint ); @@ -1181,7 +1181,6 @@ void fxDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor) us->blendSrcFuncRGB=sfact; us->blendSrcFuncAlpha=asfact; fxMesa->new_state |= FX_NEW_BLEND; - ctx->Driver.RenderStart = fxSetupFXUnits; } switch(dfactor) { @@ -1235,7 +1234,6 @@ void fxDDBlendFunc(GLcontext *ctx, GLenum sfactor, GLenum dfactor) us->blendDstFuncRGB=dfact; us->blendDstFuncAlpha=adfact; fxMesa->new_state |= FX_NEW_BLEND; - ctx->Driver.RenderStart = fxSetupFXUnits; } } @@ -1296,13 +1294,11 @@ void fxDDAlphaFunc(GLcontext *ctx, GLenum func, GLclampf ref) if(newfunc!=us->alphaTestFunc) { us->alphaTestFunc=newfunc; fxMesa->new_state |= FX_NEW_ALPHA; - ctx->Driver.RenderStart = fxSetupFXUnits; } if(ctx->Color.AlphaRef!=us->alphaTestRefValue) { us->alphaTestRefValue=ctx->Color.AlphaRef; fxMesa->new_state |= FX_NEW_ALPHA; - ctx->Driver.RenderStart = fxSetupFXUnits; } } @@ -1363,7 +1359,6 @@ void fxDDDepthFunc(GLcontext *ctx, GLenum func) if(dfunc!=us->depthTestFunc) { us->depthTestFunc=dfunc; fxMesa->new_state |= FX_NEW_DEPTH; - ctx->Driver.RenderStart = fxSetupFXUnits; } } @@ -1376,7 +1371,6 @@ void fxDDDepthMask(GLcontext *ctx, GLboolean flag) if(flag!=us->depthMask) { us->depthMask=flag; fxMesa->new_state |= FX_NEW_DEPTH; - ctx->Driver.RenderStart = fxSetupFXUnits; } } @@ -1405,7 +1399,6 @@ void fxDDColorMask(GLcontext *ctx, { fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; fxMesa->new_state |= FX_NEW_COLOR_MASK; - ctx->Driver.RenderStart = fxSetupFXUnits; (void) r; (void) g; (void) b; (void) a; } @@ -1482,7 +1475,6 @@ static void fxSetupFog(GLcontext *ctx) void fxDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) { FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG; - ctx->Driver.RenderStart = fxSetupFXUnits; /* XXX why is this here? */ } /************************************************************************/ @@ -1528,7 +1520,6 @@ static void fxSetupScissor(GLcontext *ctx) void fxDDScissor( GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h ) { FX_CONTEXT(ctx)->new_state |= FX_NEW_SCISSOR; - ctx->Driver.RenderStart = fxSetupFXUnits; } /************************************************************************/ @@ -1540,14 +1531,12 @@ void fxDDCullFace(GLcontext *ctx, GLenum mode) { (void) mode; FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL; - ctx->Driver.RenderStart = fxSetupFXUnits; } void fxDDFrontFace(GLcontext *ctx, GLenum mode) { (void) mode; FX_CONTEXT(ctx)->new_state |= FX_NEW_CULL; - ctx->Driver.RenderStart = fxSetupFXUnits; } @@ -1597,21 +1586,18 @@ void fxDDEnable(GLcontext *ctx, GLenum cap, GLboolean state) if(state!=us->alphaTestEnabled) { us->alphaTestEnabled=state; fxMesa->new_state |= FX_NEW_ALPHA; - ctx->Driver.RenderStart = fxSetupFXUnits; } break; case GL_BLEND: if(state!=us->blendEnabled) { us->blendEnabled=state; fxMesa->new_state |= FX_NEW_BLEND; - ctx->Driver.RenderStart = fxSetupFXUnits; } break; case GL_DEPTH_TEST: if(state!=us->depthTestEnabled) { us->depthTestEnabled=state; fxMesa->new_state |= FX_NEW_DEPTH; - ctx->Driver.RenderStart = fxSetupFXUnits; } break; case GL_DITHER: @@ -1623,18 +1609,15 @@ void fxDDEnable(GLcontext *ctx, GLenum cap, GLboolean state) break; case GL_SCISSOR_TEST: fxMesa->new_state |= FX_NEW_SCISSOR; - ctx->Driver.RenderStart = fxSetupFXUnits; break; case GL_SHARED_TEXTURE_PALETTE_EXT: fxDDTexUseGlbPalette(ctx, state); break; case GL_FOG: fxMesa->new_state |= FX_NEW_FOG; - ctx->Driver.RenderStart = fxSetupFXUnits; break; case GL_CULL_FACE: fxMesa->new_state |= FX_NEW_CULL; - ctx->Driver.RenderStart = fxSetupFXUnits; break; case GL_LINE_SMOOTH: case GL_LINE_STIPPLE: @@ -1642,7 +1625,6 @@ void fxDDEnable(GLcontext *ctx, GLenum cap, GLboolean state) case GL_POLYGON_SMOOTH: case GL_TEXTURE_2D: fxMesa->new_state |= FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; break; default: ; /* XXX no-op? */ @@ -1781,7 +1763,6 @@ static GLboolean fxMultipassTexture( struct vertex_buffer *VB, GLuint pass ) void fxDDShadeModel(GLcontext *ctx, GLenum mode) { FX_CONTEXT(ctx)->new_state |= FX_NEW_TEXTURING; - ctx->Driver.RenderStart = fxSetupFXUnits; } @@ -1789,7 +1770,7 @@ void fxDDShadeModel(GLcontext *ctx, GLenum mode) /************************************************************************/ /****************************** Units SetUp *****************************/ /************************************************************************/ -static void gl_print_fx_state_flags( const char *msg, GLuint flags ) +static void fx_print_state_flags( const char *msg, GLuint flags ) { fprintf(stderr, "%s: (0x%x) %s%s%s%s%s%s%s\n", @@ -1810,7 +1791,7 @@ void fxSetupFXUnits( GLcontext *ctx ) GLuint newstate = fxMesa->new_state; if (MESA_VERBOSE&VERBOSE_DRIVER) - gl_print_fx_state_flags("fxmesa: fxSetupFXUnits", newstate); + fx_print_state_flags("fxmesa: fxSetupFXUnits", newstate); if (newstate) { if (newstate & FX_NEW_TEXTURING) @@ -1834,10 +1815,8 @@ void fxSetupFXUnits( GLcontext *ctx ) if (newstate & FX_NEW_COLOR_MASK) fxSetupColorMask(ctx); - if (newstate & FX_NEW_CULL) { - + if (newstate & FX_NEW_CULL) fxSetupCull(ctx); - } fxMesa->draw_point = fxMesa->initial_point; fxMesa->draw_line = fxMesa->initial_line; @@ -1855,6 +1834,7 @@ void fxSetupFXUnits( GLcontext *ctx ) * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_setup(void); int gl_fx_dummy_function_setup(void) { return 0; diff --git a/src/mesa/drivers/glide/fxtexman.c b/src/mesa/drivers/glide/fxtexman.c index 3944ea2ef6..b98ccedd3f 100644 --- a/src/mesa/drivers/glide/fxtexman.c +++ b/src/mesa/drivers/glide/fxtexman.c @@ -738,6 +738,7 @@ fxTMRestoreTextures_NoLock(fxMesaContext ctx) { * Need this to provide at least one external definition. */ +extern int gl_fx_dummy_function_texman(void); int gl_fx_dummy_function_texman(void) { return 0; |