diff options
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxapi.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 27 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdrv.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxtris.c | 4 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxwgl.c | 15 |
6 files changed, 20 insertions, 35 deletions
diff --git a/src/mesa/drivers/glide/fxapi.c b/src/mesa/drivers/glide/fxapi.c index 75629cbd3f2..50f783f3b25 100644 --- a/src/mesa/drivers/glide/fxapi.c +++ b/src/mesa/drivers/glide/fxapi.c @@ -42,6 +42,8 @@ #if defined(FX) #include "fxdrv.h" +#include "drivers/common/driverfuncs.h" + #ifndef TDFX_DEBUG int TDFX_DEBUG = (0 /* | VERBOSE_VARRAY */ @@ -653,7 +655,6 @@ fxMesaCreateContext(GLuint win, } _mesa_init_driver_functions(&functions); - ctx->Driver. ctx = fxMesa->glCtx = _mesa_create_context(fxMesa->glVis, shareCtx, &functions, (void *) fxMesa); if (!ctx) { diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 6e66f599aad..a07a27bad49 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1498,6 +1498,11 @@ fxDDInitExtensions(GLcontext * ctx) if (fxMesa->HaveMirExt) { _mesa_enable_extension(ctx, "GL_ARB_texture_mirrored_repeat"); } + + /* core-level extensions */ +#if 1 + _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object"); +#endif } @@ -1666,9 +1671,6 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Clear = fxDDClear; ctx->Driver.DrawBuffer = fxDDSetDrawBuffer; ctx->Driver.GetBufferSize = fxDDBufferSize; - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; switch (fxMesa->colDepth) { case 15: ctx->Driver.ReadPixels = fxDDReadPixels555; @@ -1684,34 +1686,15 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Bitmap = fxDDDrawBitmap4; break; } - ctx->Driver.ResizeBuffers = _swrast_alloc_buffers; ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat; - 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.CompressedTexImage1D = _mesa_store_compressed_teximage1d; ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D; - ctx->Driver.CompressedTexImage3D = _mesa_store_compressed_teximage3d; - ctx->Driver.CompressedTexSubImage1D = _mesa_store_compressed_texsubimage1d; ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D; - ctx->Driver.CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; ctx->Driver.IsCompressedFormat = fxDDIsCompressedFormat; ctx->Driver.CompressedTextureSize = fxDDCompressedTextureSize; - 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; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 62f4ad15ee7..a6a5dc5aa79 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -148,7 +148,6 @@ fxDDTexBind(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj) tObj->DriverData = fxAllocTexObjData(fxMesa); } ti = fxTMGetTexInfo(tObj); - assert(ti); fxMesa->texBindNumber++; ti->lastTimeUsed = fxMesa->texBindNumber; @@ -203,7 +202,6 @@ fxDDTexParam(GLcontext * ctx, GLenum target, struct gl_texture_object *tObj, if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); ti = fxTMGetTexInfo(tObj); - assert(ti); switch (pname) { case GL_TEXTURE_MIN_FILTER: @@ -482,7 +480,6 @@ fxDDTexPalette(GLcontext * ctx, struct gl_texture_object *tObj) if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); ti = fxTMGetTexInfo(tObj); - assert(ti); ti->paltype = convertPalette(fxMesa, ti->palette.data, &tObj->Palette); fxTexInvalidate(ctx, tObj); } @@ -519,7 +516,6 @@ fxDDTexUseGlbPalette(GLcontext * ctx, GLboolean state) struct gl_texture_object *tObj = ctx->Texture.Unit[0]._Current; if (!tObj->DriverData) tObj->DriverData = fxAllocTexObjData(fxMesa); - assert(tObj->DriverData); fxTexInvalidate(ctx, tObj); } } diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index 1f31f621604..1b42be8e7bb 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -59,8 +59,6 @@ #include "math/m_vector.h" -#include "drivers/common/driverfuncs.h" - /* Define some shorter names for these things. */ diff --git a/src/mesa/drivers/glide/fxtris.c b/src/mesa/drivers/glide/fxtris.c index a5165684a37..3b82b570eb7 100644 --- a/src/mesa/drivers/glide/fxtris.c +++ b/src/mesa/drivers/glide/fxtris.c @@ -1215,14 +1215,14 @@ static void fxRunPipeline( GLcontext *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)) { + if (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)) { + if (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; diff --git a/src/mesa/drivers/glide/fxwgl.c b/src/mesa/drivers/glide/fxwgl.c index adf88a485c6..ae1d913f3bf 100644 --- a/src/mesa/drivers/glide/fxwgl.c +++ b/src/mesa/drivers/glide/fxwgl.c @@ -218,7 +218,6 @@ struct __pixelformat__ pix[] = { FXMESA_NONE} } }; -static int qt_pix = sizeof(pix) / sizeof(pix[0]); static fxMesaContext ctx = NULL; static WNDPROC hWNDOldProc; @@ -676,6 +675,14 @@ wglSwapLayerBuffers(HDC hdc, UINT fuPlanes) return (FALSE); } +static int pfd_tablen (void) +{ + /* we should take an envvar for `fxMesaSelectCurrentBoard' */ + return (fxMesaSelectCurrentBoard(0) < GR_SSTTYPE_Voodoo4) + ? 2 /* only 16bit entries */ + : sizeof(pix) / sizeof(pix[0]); /* full table */ +} + GLAPI int GLAPIENTRY wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) { @@ -723,7 +730,7 @@ wglChoosePixelFormat(HDC hdc, const PIXELFORMATDESCRIPTOR * ppfd) } #endif - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (ppfd->nSize != sizeof(PIXELFORMATDESCRIPTOR) || ppfd->nVersion != 1) { SetLastError(0); @@ -787,7 +794,7 @@ wglDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, { int qt_valid_pix; - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix || ((nBytes != sizeof(PIXELFORMATDESCRIPTOR)) && (nBytes != 0))) { @@ -830,7 +837,7 @@ wglSetPixelFormat(HDC hdc, int iPixelFormat, const PIXELFORMATDESCRIPTOR * ppfd) { int qt_valid_pix; - qt_valid_pix = qt_pix; + qt_valid_pix = pfd_tablen(); if (iPixelFormat < 1 || iPixelFormat > qt_valid_pix) { if (ppfd == NULL) { |