From 4fe1303e833183319f50107a98b8627f36633c65 Mon Sep 17 00:00:00 2001 From: Daniel Borca Date: Thu, 29 Jan 2004 15:46:02 +0000 Subject: GL_TEXTURE_1D and other stories... --- src/mesa/drivers/glide/fxdd.c | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'src/mesa/drivers/glide/fxdd.c') diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index ef73f79641..448fd043d0 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -1501,6 +1501,11 @@ fxDDInitExtensions(GLcontext * ctx) /* core-level extensions */ #if 1 _mesa_enable_extension(ctx, "GL_ARB_vertex_buffer_object"); +#endif + /* not just yet */ +#if 0 + _mesa_enable_extension(ctx, "GL_ARB_fragment_program"); + _mesa_enable_extension(ctx, "GL_ARB_vertex_program"); #endif } @@ -1540,6 +1545,13 @@ fx_check_IsInHardware(GLcontext * ctx) } } + /* [dBorca] + * We could avoid this for certain `sfactor/dfactor' + * I do not think that is even worthwhile to check + * because if someone is using blending they use more + * interesting settings and also it would add more + * state tracking to a lot of the code. + */ if (ctx->Color.ColorLogicOpEnabled && (ctx->Color.LogicOp != GL_COPY)) { return FX_FALLBACK_LOGICOP; } @@ -1558,17 +1570,18 @@ fx_check_IsInHardware(GLcontext * ctx) /* Unsupported texture/multitexture cases */ + /* we can only do 1D/2D textures */ + if (ctx->Texture.Unit[0]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT)) + return FX_FALLBACK_TEXTURE_MAP; + if (fxMesa->haveTwoTMUs) { - /* we can only do 2D textures */ - if (ctx->Texture.Unit[0]._ReallyEnabled & ~TEXTURE_2D_BIT) - return FX_FALLBACK_TEXTURE_1D_3D; - if (ctx->Texture.Unit[1]._ReallyEnabled & ~TEXTURE_2D_BIT) - return FX_FALLBACK_TEXTURE_1D_3D; + if (ctx->Texture.Unit[1]._ReallyEnabled & ~(TEXTURE_1D_BIT|TEXTURE_2D_BIT)) + return FX_FALLBACK_TEXTURE_MAP; - if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) { + if (ctx->Texture.Unit[0]._ReallyEnabled) { if (fxMesa->type < GR_SSTTYPE_Voodoo2) if (ctx->Texture.Unit[0].EnvMode == GL_BLEND && - (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT || + (ctx->Texture.Unit[1]._ReallyEnabled || ctx->Texture.Unit[0].EnvColor[0] != 0 || ctx->Texture.Unit[0].EnvColor[1] != 0 || ctx->Texture.Unit[0].EnvColor[2] != 0 || @@ -1579,7 +1592,7 @@ fx_check_IsInHardware(GLcontext * ctx) return FX_FALLBACK_TEXTURE_BORDER; } - if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) { + if (ctx->Texture.Unit[1]._ReallyEnabled) { if (fxMesa->type < GR_SSTTYPE_Voodoo2) if (ctx->Texture.Unit[1].EnvMode == GL_BLEND) return FX_FALLBACK_TEXTURE_ENV; @@ -1600,6 +1613,8 @@ fx_check_IsInHardware(GLcontext * ctx) if (ctx->Texture._EnabledUnits == 0x3) { /* Can't use multipass to blend a multitextured triangle - fall * back to software. + * [dBorca] we hit this case only when we try to emulate + * multitexture by multipass! */ if (!fxMesa->haveTwoTMUs && ctx->Color.BlendEnabled) { return FX_FALLBACK_TEXTURE_MULTI; @@ -1621,7 +1636,7 @@ fx_check_IsInHardware(GLcontext * ctx) } if (fxMesa->type < GR_SSTTYPE_Voodoo2) - if ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) && + if (ctx->Texture.Unit[0]._ReallyEnabled && (ctx->Texture.Unit[0].EnvMode == GL_BLEND)) { return FX_FALLBACK_TEXTURE_ENV; } @@ -1688,12 +1703,14 @@ fxSetupDDPointers(GLcontext * ctx) ctx->Driver.Finish = fxDDFinish; ctx->Driver.Flush = NULL; ctx->Driver.ChooseTextureFormat = fxDDChooseTextureFormat; + ctx->Driver.TexImage1D = fxDDTexImage1D; ctx->Driver.TexImage2D = fxDDTexImage2D; ctx->Driver.TexSubImage2D = fxDDTexSubImage2D; ctx->Driver.CompressedTexImage2D = fxDDCompressedTexImage2D; ctx->Driver.CompressedTexSubImage2D = fxDDCompressedTexSubImage2D; ctx->Driver.IsCompressedFormat = fxDDIsCompressedFormat; ctx->Driver.CompressedTextureSize = fxDDCompressedTextureSize; + ctx->Driver.TestProxyTexImage = fxDDTestProxyTexImage; ctx->Driver.TexEnv = fxDDTexEnv; ctx->Driver.TexParameter = fxDDTexParam; ctx->Driver.BindTexture = fxDDTexBind; -- cgit v1.2.3