summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/glide
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r--src/mesa/drivers/glide/fxdd.c32
-rw-r--r--src/mesa/drivers/glide/fxsetup.c38
-rw-r--r--src/mesa/drivers/glide/fxvb.c8
3 files changed, 31 insertions, 47 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index caff948851..2fb1a2ada4 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -1,4 +1,4 @@
-/* $Id: fxdd.c,v 1.87 2002/06/15 02:38:16 brianp Exp $ */
+/* $Id: fxdd.c,v 1.88 2002/06/15 03:03:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -841,14 +841,15 @@ fx_check_IsInHardware(GLcontext * ctx)
/* Unsupported texture/multitexture cases */
if (fxMesa->haveTwoTMUs) {
- if (ctx->Texture._ReallyEnabled & (TEXTURE0_3D | TEXTURE1_3D))
- return GL_FALSE; /* can't do 3D textures */
- if (ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE1_1D))
- return GL_FALSE; /* can't do 1D textures */
+ /* we can only do 2D textures */
+ if (ctx->Texture.Unit[0]._ReallyEnabled & ~TEXTURE_2D_BIT)
+ return GL_FALSE;
+ if (ctx->Texture.Unit[1]._ReallyEnabled & ~TEXTURE_2D_BIT)
+ return GL_FALSE;
- if (ctx->Texture._ReallyEnabled & TEXTURE0_2D) {
+ if (ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) {
if (ctx->Texture.Unit[0].EnvMode == GL_BLEND &&
- (ctx->Texture._ReallyEnabled & TEXTURE1_2D ||
+ (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT ||
ctx->Texture.Unit[0].EnvColor[0] != 0 ||
ctx->Texture.Unit[0].EnvColor[1] != 0 ||
ctx->Texture.Unit[0].EnvColor[2] != 0 ||
@@ -859,7 +860,7 @@ fx_check_IsInHardware(GLcontext * ctx)
return GL_FALSE;
}
- if (ctx->Texture._ReallyEnabled & TEXTURE1_2D) {
+ if (ctx->Texture.Unit[1]._ReallyEnabled & TEXTURE_2D_BIT) {
if (ctx->Texture.Unit[1].EnvMode == GL_BLEND)
return GL_FALSE;
if (ctx->Texture.Unit[1]._Current->Image[0]->Border > 0)
@@ -873,9 +874,10 @@ fx_check_IsInHardware(GLcontext * ctx)
/* KW: This was wrong (I think) and I changed it... which doesn't mean
* it is now correct...
+ * BP: The old condition just seemed to test if both texture units
+ * were enabled. That's easy!
*/
- if ((ctx->Texture._ReallyEnabled & (TEXTURE0_1D | TEXTURE0_2D | TEXTURE0_3D)) &&
- (ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D))) {
+ if (ctx->Texture._EnabledUnits == 0x3) {
/* Can't use multipass to blend a multitextured triangle - fall
* back to software.
*/
@@ -893,16 +895,12 @@ fx_check_IsInHardware(GLcontext * ctx)
}
}
else {
- if ((ctx->Texture._ReallyEnabled & (TEXTURE1_1D | TEXTURE1_2D | TEXTURE1_3D)) ||
- /* Not very well written ... */
- ((ctx->Texture._ReallyEnabled & TEXTURE0_1D) &&
- (!(ctx->Texture._ReallyEnabled & TEXTURE0_2D)))
- ) {
+ /* we have just one texture unit */
+ if (ctx->Texture._EnabledUnits > 0x1) {
return GL_FALSE;
}
-
- if ((ctx->Texture._ReallyEnabled & TEXTURE0_2D) &&
+ if ((ctx->Texture.Unit[0]._ReallyEnabled & TEXTURE_2D_BIT) &&
(ctx->Texture.Unit[0].EnvMode == GL_BLEND)) {
return GL_FALSE;
}
diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c
index 431b02a9ba..bf51635b31 100644
--- a/src/mesa/drivers/glide/fxsetup.c
+++ b/src/mesa/drivers/glide/fxsetup.c
@@ -1,4 +1,4 @@
-/* $Id: fxsetup.c,v 1.36 2001/09/23 16:50:01 brianp Exp $ */
+/* $Id: fxsetup.c,v 1.37 2002/06/15 03:03:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -1002,39 +1002,25 @@ static void
fxSetupTexture_NoLock(GLcontext * ctx)
{
fxMesaContext fxMesa = (fxMesaContext) ctx->DriverCtx;
- GLuint tex2Denabled;
if (MESA_VERBOSE & VERBOSE_DRIVER) {
fprintf(stderr, "fxmesa: fxSetupTexture(...)\n");
}
- /* Texture Combine, Color Combine and Alpha Combine.
- */
- tex2Denabled = (ctx->Texture._ReallyEnabled & TEXTURE0_2D);
-
- if (fxMesa->haveTwoTMUs)
- tex2Denabled |= (ctx->Texture._ReallyEnabled & TEXTURE1_2D);
-
- switch (tex2Denabled) {
- case TEXTURE0_2D:
+ /* Texture Combine, Color Combine and Alpha Combine. */
+ if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT &&
+ ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT &&
+ fxMesa->haveTwoTMUs) {
+ fxSetupTextureDoubleTMU_NoLock(ctx);
+ }
+ else if (ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT) {
fxSetupTextureSingleTMU_NoLock(ctx, 0);
- break;
- case TEXTURE1_2D:
+ }
+ else if (ctx->Texture.Unit[1]._ReallyEnabled == TEXTURE_2D_BIT) {
fxSetupTextureSingleTMU_NoLock(ctx, 1);
- break;
- case (TEXTURE0_2D | TEXTURE1_2D):
- if (fxMesa->haveTwoTMUs)
- fxSetupTextureDoubleTMU_NoLock(ctx);
- else {
- if (MESA_VERBOSE & VERBOSE_DRIVER)
- fprintf(stderr, "fxmesa: enabling fake multitexture\n");
-
- fxSetupTextureSingleTMU_NoLock(ctx, 0);
- }
- break;
- default:
+ }
+ else {
fxSetupTextureNone_NoLock(ctx);
- break;
}
}
diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c
index f0534b65ec..24e01af096 100644
--- a/src/mesa/drivers/glide/fxvb.c
+++ b/src/mesa/drivers/glide/fxvb.c
@@ -1,4 +1,4 @@
-/* $Id: fxvb.c,v 1.13 2002/06/15 02:38:16 brianp Exp $ */
+/* $Id: fxvb.c,v 1.14 2002/06/15 03:03:10 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -342,8 +342,8 @@ void fxChooseVertexState( GLcontext *ctx )
fxMesa->tmu_source[0] = 0;
fxMesa->tmu_source[1] = 1;
- if (ctx->Texture._ReallyEnabled & TEXTURE1_ANY) {
- if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) {
+ if (ctx->Texture._EnabledUnits & 0x2) {
+ if (ctx->Texture._EnabledUnits & 0x1) {
ind |= SETUP_TMU1|SETUP_TMU0;
}
else {
@@ -352,7 +352,7 @@ void fxChooseVertexState( GLcontext *ctx )
ind |= SETUP_TMU0;
}
}
- else if (ctx->Texture._ReallyEnabled & TEXTURE0_ANY) {
+ else if (ctx->Texture._EnabledUnits & 0x1) {
ind |= SETUP_TMU0;
}