diff options
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 77 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxddspan.c | 60 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxtris.c | 29 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxvb.c | 7 |
4 files changed, 83 insertions, 90 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 83a5196683..d389124ff5 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -60,6 +60,7 @@ #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" +#include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "array_cache/acache.h" @@ -300,27 +301,6 @@ fxDDSetDrawBuffer(GLcontext * ctx, GLenum mode) } -/* Set the buffer used for reading */ -/* XXX support for separate read/draw buffers hasn't been tested */ -static void -fxDDSetReadBuffer(GLcontext * ctx, GLframebuffer * buffer, GLenum mode) -{ - fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; - (void) buffer; - - if (MESA_VERBOSE & VERBOSE_DRIVER) { - fprintf(stderr, "fxmesa: fxDDSetBuffer(%x)\n", (int) mode); - } - - if (mode == GL_FRONT_LEFT) { - fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); - } - else if (mode == GL_BACK_LEFT) { - fxMesa->currentFB = GR_BUFFER_BACKBUFFER; - FX_grRenderBuffer(fxMesa->currentFB); - } -} @@ -984,6 +964,7 @@ update_texture_scales(GLcontext * ctx) static void fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) { + TNLcontext *tnl = TNL_CONTEXT(ctx); fxMesaContext fxMesa = FX_CONTEXT(ctx); _swrast_InvalidateState(ctx, new_state); @@ -1000,7 +981,6 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) 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); @@ -1012,7 +992,7 @@ fxDDUpdateDDPointers(GLcontext * ctx, GLuint new_state) fxDDChooseRenderState(ctx); if (new_state & _FX_NEW_SETUP_FUNCTION) - ctx->Driver.BuildProjectedVertices = fx_validate_BuildProjVerts; + tnl->Driver.BuildProjectedVertices = fx_validate_BuildProjVerts; if (new_state & _NEW_TEXTURE) update_texture_scales(ctx); @@ -1071,68 +1051,48 @@ fxDDRenderFinish(GLcontext * ctx) void fxSetupDDPointers(GLcontext * ctx) { + TNLcontext *tnl = TNL_CONTEXT(ctx); + if (MESA_VERBOSE & VERBOSE_DRIVER) { fprintf(stderr, "fxmesa: fxSetupDDPointers()\n"); } ctx->Driver.UpdateState = fxDDUpdateDDPointers; - - ctx->Driver.WriteDepthSpan = fxDDWriteDepthSpan; - ctx->Driver.WriteDepthPixels = fxDDWriteDepthPixels; - ctx->Driver.ReadDepthSpan = fxDDReadDepthSpan; - ctx->Driver.ReadDepthPixels = fxDDReadDepthPixels; - ctx->Driver.GetString = fxDDGetString; - ctx->Driver.ClearIndex = NULL; ctx->Driver.ClearColor = fxDDClearColor; ctx->Driver.Clear = fxDDClear; - ctx->Driver.SetDrawBuffer = fxDDSetDrawBuffer; - ctx->Driver.SetReadBuffer = fxDDSetReadBuffer; ctx->Driver.GetBufferSize = fxDDBufferSize; - ctx->Driver.Accum = _swrast_Accum; ctx->Driver.Bitmap = fxDDDrawBitmap; ctx->Driver.CopyPixels = _swrast_CopyPixels; ctx->Driver.DrawPixels = _swrast_DrawPixels; ctx->Driver.ReadPixels = fxDDReadPixels; ctx->Driver.ResizeBuffersMESA = _swrast_alloc_buffers; - ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; - - ctx->Driver.RenderStart = fxDDRenderStart; - ctx->Driver.RenderFinish = fxDDRenderFinish; - ctx->Driver.ResetLineStipple = _swrast_ResetLineStipple; - ctx->Driver.RenderPrimitive = fxDDRenderPrimitive; - - /* Install the oldstyle interp functions: - */ - ctx->Driver.RenderInterp = _swsetup_RenderInterp; - ctx->Driver.RenderCopyPV = _swsetup_RenderCopyPV; - ctx->Driver.RenderClippedLine = _swsetup_RenderClippedLine; - ctx->Driver.RenderClippedPolygon = _swsetup_RenderClippedPolygon; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; ctx->Driver.TexImage2D = fxDDTexImage2D; ctx->Driver.TexImage3D = _mesa_store_teximage3d; ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; ctx->Driver.TexSubImage2D = fxDDTexSubImage2D; ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.CopyTexImage1D = _mesa_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _mesa_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _mesa_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _mesa_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _mesa_copy_texsubimage3d; + ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; + ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; + ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; + ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; + ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - + ctx->Driver.CopyColorTable = _swrast_CopyColorTable; + ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; + ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; + ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; ctx->Driver.TexEnv = fxDDTexEnv; ctx->Driver.TexParameter = fxDDTexParam; ctx->Driver.BindTexture = fxDDTexBind; ctx->Driver.DeleteTexture = fxDDTexDel; ctx->Driver.UpdateTexturePalette = fxDDTexPalette; - ctx->Driver.AlphaFunc = fxDDAlphaFunc; ctx->Driver.BlendFunc = fxDDBlendFunc; ctx->Driver.DepthFunc = fxDDDepthFunc; @@ -1145,7 +1105,14 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.ShadeModel = fxDDShadeModel; ctx->Driver.Enable = fxDDEnable; - + tnl->Driver.RenderStart = fxDDRenderStart; + tnl->Driver.RenderFinish = fxDDRenderFinish; + tnl->Driver.ResetLineStipple = _swrast_ResetLineStipple; + tnl->Driver.RenderPrimitive = fxDDRenderPrimitive; + tnl->Driver.RenderInterp = _swsetup_RenderInterp; + tnl->Driver.RenderCopyPV = _swsetup_RenderCopyPV; + tnl->Driver.RenderClippedLine = _swsetup_RenderClippedLine; + tnl->Driver.RenderClippedPolygon = _swsetup_RenderClippedPolygon; fxSetupDDSpanPointers(ctx); fxDDUpdateDDPointers(ctx, ~0); diff --git a/src/mesa/drivers/glide/fxddspan.c b/src/mesa/drivers/glide/fxddspan.c index e02e792dea..6d59e96f46 100644 --- a/src/mesa/drivers/glide/fxddspan.c +++ b/src/mesa/drivers/glide/fxddspan.c @@ -52,6 +52,7 @@ #if defined(FX) #include "fxdrv.h" +#include "swrast/swrast.h" #ifdef _MSC_VER #ifdef _WIN32 @@ -542,31 +543,54 @@ fxDDReadDepthPixels(GLcontext * ctx, GLuint n, +/* Set the buffer used for reading */ +/* XXX support for separate read/draw buffers hasn't been tested */ +static void +fxDDSetReadBuffer(GLcontext * ctx, GLframebuffer * buffer, GLenum mode) +{ + fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; + (void) buffer; + + if (MESA_VERBOSE & VERBOSE_DRIVER) { + fprintf(stderr, "fxmesa: fxDDSetBuffer(%x)\n", (int) mode); + } + + if (mode == GL_FRONT_LEFT) { + fxMesa->currentFB = GR_BUFFER_FRONTBUFFER; + FX_grRenderBuffer(fxMesa->currentFB); + } + else if (mode == GL_BACK_LEFT) { + fxMesa->currentFB = GR_BUFFER_BACKBUFFER; + FX_grRenderBuffer(fxMesa->currentFB); + } +} + /************************************************************************/ + void fxSetupDDSpanPointers(GLcontext * ctx) { - ctx->Driver.WriteRGBASpan = fxDDWriteRGBASpan; - ctx->Driver.WriteRGBSpan = fxDDWriteRGBSpan; - ctx->Driver.WriteMonoRGBASpan = fxDDWriteMonoRGBASpan; - ctx->Driver.WriteRGBAPixels = fxDDWriteRGBAPixels; - ctx->Driver.WriteMonoRGBAPixels = fxDDWriteMonoRGBAPixels; - - ctx->Driver.WriteCI8Span = NULL; - ctx->Driver.WriteCI32Span = NULL; - ctx->Driver.WriteMonoCISpan = NULL; - ctx->Driver.WriteCI32Pixels = NULL; - ctx->Driver.WriteMonoCIPixels = NULL; - - /* ctx->Driver.ReadRGBASpan =fxDDReadRGBASpan; */ - ctx->Driver.ReadRGBASpan = read_R5G6B5_span; - ctx->Driver.ReadRGBAPixels = read_R5G6B5_pixels; - - ctx->Driver.ReadCI32Span = NULL; - ctx->Driver.ReadCI32Pixels = NULL; + struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); + + swdd->SetReadBuffer = fxDDSetReadBuffer; + + swdd->WriteRGBASpan = fxDDWriteRGBASpan; + swdd->WriteRGBSpan = fxDDWriteRGBSpan; + swdd->WriteMonoRGBASpan = fxDDWriteMonoRGBASpan; + swdd->WriteRGBAPixels = fxDDWriteRGBAPixels; + swdd->WriteMonoRGBAPixels = fxDDWriteMonoRGBAPixels; + + swdd->WriteDepthSpan = fxDDWriteDepthSpan; + swdd->WriteDepthPixels = fxDDWriteDepthPixels; + swdd->ReadDepthSpan = fxDDReadDepthSpan; + swdd->ReadDepthPixels = fxDDReadDepthPixels; + + /* swdd->ReadRGBASpan =fxDDReadRGBASpan; */ + swdd->ReadRGBASpan = read_R5G6B5_span; + swdd->ReadRGBAPixels = read_R5G6B5_pixels; } diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index a0c8383fdd..22a4c8cde3 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -531,6 +531,7 @@ fx_null_tri(GLcontext * ctx, void fxDDChooseRenderState(GLcontext * ctx) { + TNLcontext *tnl = TNL_CONTEXT(ctx); fxMesaContext fxMesa = FX_CONTEXT(ctx); GLuint flags = ctx->_TriangleCaps; GLuint index = 0; @@ -539,12 +540,12 @@ fxDDChooseRenderState(GLcontext * ctx) /* Build software vertices directly. No acceleration is * possible. GrVertices may be insufficient for this mode. */ - ctx->Driver.PointsFunc = _swsetup_Points; - ctx->Driver.LineFunc = _swsetup_Line; - ctx->Driver.TriangleFunc = _swsetup_Triangle; - ctx->Driver.QuadFunc = _swsetup_Quad; - ctx->Driver.RenderTabVerts = _tnl_render_tab_verts; - ctx->Driver.RenderTabElts = _tnl_render_tab_elts; + tnl->Driver.PointsFunc = _swsetup_Points; + tnl->Driver.LineFunc = _swsetup_Line; + tnl->Driver.TriangleFunc = _swsetup_Triangle; + tnl->Driver.QuadFunc = _swsetup_Quad; + tnl->Driver.RenderTabVerts = _tnl_render_tab_verts; + tnl->Driver.RenderTabElts = _tnl_render_tab_elts; fxMesa->render_index = FX_FALLBACK_BIT; return; @@ -604,19 +605,19 @@ fxDDChooseRenderState(GLcontext * ctx) FX_grCullMode(fxMesa->cullMode); } - ctx->Driver.PointsFunc = rast_tab[index].points; - ctx->Driver.LineFunc = rast_tab[index].line; - ctx->Driver.TriangleFunc = rast_tab[index].triangle; - ctx->Driver.QuadFunc = rast_tab[index].quad; + tnl->Driver.PointsFunc = rast_tab[index].points; + tnl->Driver.LineFunc = rast_tab[index].line; + tnl->Driver.TriangleFunc = rast_tab[index].triangle; + tnl->Driver.QuadFunc = rast_tab[index].quad; fxMesa->render_index = index; if (fxMesa->render_index == 0) { - ctx->Driver.RenderTabVerts = fx_render_tab_verts; - ctx->Driver.RenderTabElts = fx_render_tab_elts; + tnl->Driver.RenderTabVerts = fx_render_tab_verts; + tnl->Driver.RenderTabElts = fx_render_tab_elts; } else { - ctx->Driver.RenderTabVerts = _tnl_render_tab_verts; - ctx->Driver.RenderTabElts = _tnl_render_tab_elts; + tnl->Driver.RenderTabVerts = _tnl_render_tab_verts; + tnl->Driver.RenderTabElts = _tnl_render_tab_elts; } } diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 40acbb7e9e..470ee748bb 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -290,10 +290,11 @@ void fx_validate_BuildProjVerts(GLcontext * ctx, GLuint start, GLuint count, GLuint newinputs) { + TNLcontext *tnl = TNL_CONTEXT(ctx); fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx; if (!fxMesa->is_in_hardware) - ctx->Driver.BuildProjectedVertices = _swsetup_BuildProjectedVertices; + tnl->Driver.BuildProjectedVertices = _swsetup_BuildProjectedVertices; else { GLuint setupindex = SETUP_XYZW; @@ -329,9 +330,9 @@ fx_validate_BuildProjVerts(GLcontext * ctx, GLuint start, GLuint count, fxPrintSetupFlags("fxmesa: vertex setup function", setupindex); fxMesa->setupindex = setupindex; - ctx->Driver.BuildProjectedVertices = fx_BuildProjVerts; + tnl->Driver.BuildProjectedVertices = fx_BuildProjVerts; } - ctx->Driver.BuildProjectedVertices(ctx, start, count, newinputs); + tnl->Driver.BuildProjectedVertices(ctx, start, count, newinputs); } |