summaryrefslogtreecommitdiff
path: root/xc/extras/Mesa/src/FX/fxsetup.c
diff options
context:
space:
mode:
Diffstat (limited to 'xc/extras/Mesa/src/FX/fxsetup.c')
-rw-r--r--xc/extras/Mesa/src/FX/fxsetup.c93
1 files changed, 33 insertions, 60 deletions
diff --git a/xc/extras/Mesa/src/FX/fxsetup.c b/xc/extras/Mesa/src/FX/fxsetup.c
index 9e00d152a..e8c75b7c4 100644
--- a/xc/extras/Mesa/src/FX/fxsetup.c
+++ b/xc/extras/Mesa/src/FX/fxsetup.c
@@ -183,7 +183,7 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
GLuint envmode=0;
GLuint ifmt=0;
- if((ctx->Light.ShadeModel==GL_SMOOTH) ||
+ if((ctx->Light.ShadeModel==GL_SMOOTH) || 1 ||
(ctx->Point.SmoothFlag) ||
(ctx->Line.SmoothFlag) ||
(ctx->Polygon.SmoothFlag))
@@ -191,11 +191,13 @@ static GLuint fxGetTexSetConfiguration(GLcontext *ctx,
else
unitsmode|=FX_UM_ALPHA_CONSTANT;
- if(ctx->Light.ShadeModel==GL_SMOOTH)
+ if(ctx->Light.ShadeModel==GL_SMOOTH || 1)
unitsmode|=FX_UM_COLOR_ITERATED;
else
unitsmode|=FX_UM_COLOR_CONSTANT;
+
+
/*
OpenGL Feeds Texture 0 into Texture 1
Glide Feeds Texture 1 into Texture 0
@@ -356,8 +358,8 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
FX_grTexClampMode_NoLock(GR_TMU1,ti->sClamp,ti->tClamp);
FX_grTexFilterMode_NoLock(GR_TMU0,ti->minFilt,ti->maxFilt);
FX_grTexFilterMode_NoLock(GR_TMU1,ti->minFilt,ti->maxFilt);
- FX_grTexMipMapMode_NoLock(GR_TMU0,GR_MIPMAP_NEAREST,FXTRUE);
- FX_grTexMipMapMode_NoLock(GR_TMU1,GR_MIPMAP_NEAREST,FXTRUE);
+ FX_grTexMipMapMode_NoLock(GR_TMU0,ti->mmMode,ti->LODblend);
+ FX_grTexMipMapMode_NoLock(GR_TMU1,ti->mmMode,ti->LODblend);
FX_grTexSource_NoLock(GR_TMU0,ti->tm[FX_TMU0]->startAddr,
GR_MIPMAPLEVELMASK_ODD,&(ti->info));
@@ -391,7 +393,7 @@ static void fxSetupSingleTMU_NoLock(fxMesaContext fxMesa, struct gl_texture_obje
}
static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
- FxBool LODblend, FxBool negate)
+ FxBool LODblend)
{
if (MESA_VERBOSE&VERBOSE_DRIVER) {
fprintf(stderr,"fxmesa: fxSelectSingleTMUSrc(%d,%d)\n",tmu,LODblend);
@@ -414,45 +416,23 @@ static void fxSelectSingleTMUSrc_NoLock(fxMesaContext fxMesa, GLint tmu,
}
else {
if (tmu!=FX_TMU1) {
- if (negate)
- FX_grTexCombine_NoLock(GR_TMU0,
- GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL,
- GR_COMBINE_FACTOR_ZERO,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- FXFALSE, FXFALSE);
- else
- FX_grTexCombine_NoLock(GR_TMU0,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- FXFALSE,FXFALSE);
+ FX_grTexCombine_NoLock(GR_TMU0,
+ GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
+ GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
+ FXFALSE,FXFALSE);
if (fxMesa->haveTwoTMUs) {
FX_grTexCombine_NoLock(GR_TMU1,
- GR_COMBINE_FUNCTION_ZERO,
- GR_COMBINE_FACTOR_NONE,
- GR_COMBINE_FUNCTION_ZERO,
- GR_COMBINE_FACTOR_NONE,
+ GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE,
+ GR_COMBINE_FUNCTION_ZERO, GR_COMBINE_FACTOR_NONE,
FXFALSE,FXFALSE);
}
fxMesa->tmuSrc=FX_TMU0;
}
else {
- if (negate)
- FX_grTexCombine_NoLock(GR_TMU1,
- GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL,
- GR_COMBINE_FACTOR_ZERO,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- FXFALSE, FXFALSE);
- else
- FX_grTexCombine_NoLock(GR_TMU1,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- GR_COMBINE_FUNCTION_LOCAL,
- GR_COMBINE_FACTOR_NONE,
- FXFALSE,FXFALSE);
+ FX_grTexCombine_NoLock(GR_TMU1,
+ GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
+ GR_COMBINE_FUNCTION_LOCAL,GR_COMBINE_FACTOR_NONE,
+ FXFALSE,FXFALSE);
/* GR_COMBINE_FUNCTION_SCALE_OTHER doesn't work ?!? */
@@ -490,23 +470,16 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
if (ti->whichTMU==FX_TMU_BOTH) tmu=FX_TMU0;
else tmu=ti->whichTMU;
-
- if (fxMesa->tmuSrc!=tmu ||
- (unitsmode&FX_UM_E0_BLEND !=
- fxMesa->lastUnitsMode&FX_UM_E0_BLEND)) {
- if (unitsmode&FX_UM_E0_BLEND)
- fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend, GL_FALSE);
- else
- fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend, GL_FALSE);
- }
+ if (fxMesa->tmuSrc!=tmu)
+ fxSelectSingleTMUSrc_NoLock(fxMesa, tmu, ti->LODblend);
if(textureset==0 || !fxMesa->haveTwoTMUs)
unitsmode=fxGetTexSetConfiguration(ctx,tObj,NULL);
else
unitsmode=fxGetTexSetConfiguration(ctx,NULL,tObj);
- if(fxMesa->lastUnitsMode==unitsmode)
- return;
+/* if(fxMesa->lastUnitsMode==unitsmode) */
+/* return; */
fxMesa->lastUnitsMode=unitsmode;
@@ -564,6 +537,7 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
FXFALSE);
break;
case GL_BLEND:
+#if 0
FX_grAlphaCombine_NoLock(GR_COMBINE_FUNCTION_SCALE_OTHER,
GR_COMBINE_FACTOR_LOCAL,
locala,
@@ -581,10 +555,11 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
localc,
GR_COMBINE_OTHER_TEXTURE,
FXTRUE);
-#if 0
- /* We're not enabling blending that requires multipass */
ctx->Driver.MultipassFunc = fxMultipassBlend;
-#endif
+#else
+ if (MESA_VERBOSE&VERBOSE_DRIVER)
+ fprintf(stderr,"fx Driver: GL_BLEND not yet supported\n");
+#endif
break;
case GL_REPLACE:
if((ifmt==GL_RGB) || (ifmt==GL_LUMINANCE))
@@ -614,9 +589,9 @@ static void fxSetupTextureSingleTMU_NoLock(GLcontext *ctx, GLuint textureset)
FXFALSE);
break;
default:
-#ifndef FX_SILENT
- fprintf(stderr,"fx Driver: %x Texture.EnvMode not yet supported\n",ctx->Texture.Unit[textureset].EnvMode);
-#endif
+ if (MESA_VERBOSE&VERBOSE_DRIVER)
+ fprintf(stderr, "fx Driver: %x Texture.EnvMode not yet supported\n",
+ ctx->Texture.Unit[textureset].EnvMode);
break;
}
@@ -790,8 +765,8 @@ static void fxSetupTextureDoubleTMU_NoLock(GLcontext *ctx)
unitsmode=fxGetTexSetConfiguration(ctx,tObj0,tObj1);
- if(fxMesa->lastUnitsMode==unitsmode)
- return;
+/* if(fxMesa->lastUnitsMode==unitsmode) */
+/* return; */
fxMesa->lastUnitsMode=unitsmode;
@@ -1056,7 +1031,7 @@ static void fxSetupTextureNone_NoLock(GLcontext *ctx)
fprintf(stderr,"fxmesa: fxSetupTextureNone(...)\n");
}
- if((ctx->Light.ShadeModel==GL_SMOOTH) ||
+ if((ctx->Light.ShadeModel==GL_SMOOTH) || 1 ||
(ctx->Point.SmoothFlag) ||
(ctx->Line.SmoothFlag) ||
(ctx->Polygon.SmoothFlag))
@@ -1064,7 +1039,7 @@ static void fxSetupTextureNone_NoLock(GLcontext *ctx)
else
locala=GR_COMBINE_LOCAL_CONSTANT;
- if(ctx->Light.ShadeModel==GL_SMOOTH)
+ if(ctx->Light.ShadeModel==GL_SMOOTH || 1)
localc=GR_COMBINE_LOCAL_ITERATED;
else
localc=GR_COMBINE_LOCAL_CONSTANT;
@@ -1542,8 +1517,6 @@ void fxSetScissorValues(GLcontext *ctx)
static void fxSetupScissor(GLcontext *ctx)
{
fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx;
- /* If we're not going to be setting the clip values in the CLIP_LOOP
- then make a call to it here to set it once */
if (!fxMesa->needClip) {
BEGIN_BOARD_LOCK();
fxSetScissorValues(ctx);