From e9479f24ab12081e6ad48b70b80822ff97f5cd3d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Tue, 18 Sep 2001 22:05:36 +0000 Subject: [PATCH] Fix FX driver to the point where gears & morph3d work. Textures are broken (eg. isosurf). --- src/mesa/drivers/glide/fxdd.c | 20 +++----------------- src/mesa/drivers/glide/fxdrv.h | 2 +- src/mesa/drivers/glide/fxtris.c | 19 +++++++++++-------- 3 files changed, 15 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 28341a08bba..d576fd470fa 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -657,20 +657,11 @@ int fxDDInitFxMesaContext(fxMesaContext fxMesa) { int i; - static int firsttime = 1; for (i = 0; i < 256; i++) { gl_ubyte_to_float_255_color_tab[i] = (float) i; } - if (firsttime) { -#if 00 - fxDDSetupInit(); - fxDDTrifuncInit(); -#endif - firsttime = 0; - } - FX_setupGrVertexLayout(); if (getenv("FX_EMULATE_SINGLE_TMU")) @@ -767,6 +758,7 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa) fxAllocVB(fxMesa->glCtx); fxSetupDDPointers(fxMesa->glCtx); + fxDDInitTriFuncs(fxMesa->glCtx); /* Tell the software rasterizer to use pixel fog always. */ @@ -987,10 +979,9 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) if (fxMesa->is_in_hardware) { if (new_state & _FX_NEW_RENDERSTATE) fxDDChooseRenderState(ctx); -#if 000 + if (new_state & _FX_NEW_SETUP_FUNCTION) - fxDDChooseSetupState(ctx); -#endif + fxChooseVertexState(ctx); } if (new_state & _NEW_TEXTURE) @@ -1061,11 +1052,6 @@ fxSetupDDPointers(GLcontext * ctx) tnl->Driver.RunPipeline = _tnl_run_pipeline; - /* XXX is this right? (BP) */ - /* Install swsetup for tnl->Driver.Render.*: - */ - _swsetup_Wakeup(ctx); - fxSetupDDSpanPointers(ctx); fxDDUpdateDDPointers(ctx, ~0); } diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 6f33f13e31c..dd2f6584807 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -474,7 +474,7 @@ extern void fxChooseVertexState( GLcontext *ctx ); /* fxtrifuncs: */ -extern void fxDDTrifuncInit(void); +extern void fxDDInitTriFuncs(GLcontext *); extern void fxDDChooseRenderState(GLcontext * ctx); diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index 89ace65b465..60b3628163f 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -174,6 +174,8 @@ fx_fallback_tri( fxMesaContext fxMesa, { GLcontext *ctx = fxMesa->glCtx; SWvertex v[3]; + fprintf(stderr, "%s\n", __FUNCTION__); + fx_translate_vertex( ctx, v0, &v[0] ); fx_translate_vertex( ctx, v1, &v[1] ); fx_translate_vertex( ctx, v2, &v[2] ); @@ -653,7 +655,7 @@ void fxDDChooseRenderState(GLcontext *ctx) GLuint flags = ctx->_TriangleCaps; GLuint index = 0; -/* fprintf(stderr, "%s\n", __FUNCTION__); */ + fprintf(stderr, "%s\n", __FUNCTION__); if (flags & (ANY_FALLBACK_FLAGS|ANY_RASTER_FLAGS)) { if (flags & ANY_RASTER_FLAGS) { @@ -681,13 +683,17 @@ void fxDDChooseRenderState(GLcontext *ctx) if (flags & LINE_FALLBACK) fxMesa->draw_line = fx_fallback_line; - if (flags & TRI_FALLBACK) + if (flags & TRI_FALLBACK) { + fprintf(stderr, "tri fallback\n"); fxMesa->draw_tri = fx_fallback_tri; + } index |= FX_FALLBACK_BIT; } } + fprintf(stderr, "render index %x\n", index); + tnl->Driver.Render.Points = rast_tab[index].points; tnl->Driver.Render.Line = rast_tab[index].line; tnl->Driver.Render.ClippedLine = rast_tab[index].line; @@ -779,11 +785,13 @@ void fxCheckIsInHardware( GLcontext *ctx ) if (newfallback) { if (oldfallback == 0) { + fprintf(stderr, "goint to fallback\n"); _swsetup_Wakeup( ctx ); } } else { if (oldfallback) { + fprintf(stderr, "leaving fallback\n"); _swrast_flush( ctx ); tnl->Driver.Render.Start = fxCheckTexSizes; tnl->Driver.Render.Finish = _swrast_flush; @@ -795,19 +803,15 @@ void fxCheckIsInHardware( GLcontext *ctx ) tnl->Driver.Render.ResetLineStipple = _swrast_ResetLineStipple; tnl->Driver.Render.BuildVertices = fxBuildVertices; tnl->Driver.Render.Multipass = 0; -#if 000 - fxDDChooseSetupState(ctx); -#endif + fxChooseVertexState(ctx); fxDDChooseRenderState(ctx); } } } -#if 00 void fxDDInitTriFuncs( GLcontext *ctx ) { TNLcontext *tnl = TNL_CONTEXT(ctx); - fxMesaContext fxMesa = FX_CONTEXT(ctx); static int firsttime = 1; if (firsttime) { @@ -828,7 +832,6 @@ void fxDDInitTriFuncs( GLcontext *ctx ) (void) fx_print_vertex; } -#endif #else -- 2.30.2