diff options
Diffstat (limited to 'src/mesa/drivers/glide')
-rw-r--r-- | src/mesa/drivers/glide/fxdd.c | 41 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxddtex.c | 3 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxdrv.h | 4 | ||||
-rw-r--r-- | src/mesa/drivers/glide/fxsetup.c | 15 |
4 files changed, 54 insertions, 9 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c index 6eed8ce290..3580971ae8 100644 --- a/src/mesa/drivers/glide/fxdd.c +++ b/src/mesa/drivers/glide/fxdd.c @@ -347,6 +347,8 @@ void fxDDSetNearFar(GLcontext *ctx, GLfloat n, GLfloat f) { FX_CONTEXT(ctx)->new_state |= FX_NEW_FOG; ctx->Driver.RenderStart = fxSetupFXUnits; + + FX_CONTEXT(ctx)->wscale = fabs(f)/65535.0f; } /* KW: Put the word Mesa in the render string because quakeworld @@ -360,7 +362,44 @@ static const GLubyte *fxDDGetString(GLcontext *ctx, GLenum name) #if defined(GLX_DIRECT_RENDERING) return "Mesa Glide - DRI VB/V3"; #else - return (GLubyte*)"Mesa Glide"; + { + static char buf[80]; + + if (glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_VOODOO) + { + GrVoodooConfig_t *vc = + &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.VoodooConfig; + + sprintf(buf, + "Mesa Glide v0.30 Voodoo_Graphics %d " + "CARD/%d FB/%d TM/%d TMU/%s", + glbCurrentBoard, + (vc->sliDetect ? (vc->fbRam*2) : vc->fbRam), + (vc->tmuConfig[GR_TMU0].tmuRam + + ((vc->nTexelfx>1) ? vc->tmuConfig[GR_TMU1].tmuRam : 0)), + vc->nTexelfx, + (vc->sliDetect ? "SLI" : "NOSLI")); + } + else if (glbHWConfig.SSTs[glbCurrentBoard].type==GR_SSTTYPE_SST96) + { + GrSst96Config_t *sc = + &glbHWConfig.SSTs[glbCurrentBoard].sstBoard.SST96Config; + + sprintf(buf, + "Glide v0.30 Voodoo_Rush %d " + "CARD/%d FB/%d TM/%d TMU/NOSLI", + glbCurrentBoard, + sc->fbRam, + sc->tmuConfig.tmuRam, + sc->nTexelfx); + } + else + { + strcpy(buf, "Glide v0.30 UNKNOWN"); + } + + return (GLubyte *) buf; + } #endif default: return NULL; diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 0199458685..8890902a62 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -52,7 +52,7 @@ static tfxTexInfo *fxAllocTexObjData(fxMesaContext fxMesa) tfxTexInfo *ti; int i; - if(!(ti=MALLOC(sizeof(tfxTexInfo)))) { + if(!(ti=CALLOC(sizeof(tfxTexInfo)))) { fprintf(stderr,"fx Driver: out of memory !\n"); fxCloseHardware(); exit(-1); @@ -219,6 +219,7 @@ void fxDDTexParam(GLcontext *ctx, GLenum target, struct gl_texture_object *tObj, ti->sClamp=GR_TEXTURECLAMP_WRAP; break; default: + fprintf(stderr, "BAD CLAMP\n"); break; } fxMesa->new_state|=FX_NEW_TEXTURING; diff --git a/src/mesa/drivers/glide/fxdrv.h b/src/mesa/drivers/glide/fxdrv.h index f5ef576338..aeb56e9a5d 100644 --- a/src/mesa/drivers/glide/fxdrv.h +++ b/src/mesa/drivers/glide/fxdrv.h @@ -61,7 +61,7 @@ -#if defined(MESA_DEBUG) && 0 +#if 0 extern void fx_sanity_triangle( GrVertex *, GrVertex *, GrVertex * ); #define grDrawTriangle fx_sanity_triangle #endif @@ -477,6 +477,8 @@ struct tfxMesaContext { FX_GrContext_t glideContext; + GLfloat wscale; + DRI_FX_CONTEXT }; diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index ce70b472d5..8367a1f1ff 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -36,9 +36,9 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj) tfxTexInfo *ti=(tfxTexInfo *)tObj->DriverData; GLint minl,maxl; - if (MESA_VERBOSE&VERBOSE_DRIVER) { + if (MESA_VERBOSE&VERBOSE_DRIVER) fprintf(stderr,"fxmesa: fxTexValidate(...) Start\n"); - } + if(ti->validated) { if (MESA_VERBOSE&VERBOSE_DRIVER) { @@ -50,13 +50,13 @@ static void fxTexValidate(GLcontext *ctx, struct gl_texture_object *tObj) minl=ti->minLevel=tObj->BaseLevel; maxl=ti->maxLevel=MIN2(tObj->MaxLevel,tObj->Image[0]->MaxLog2); + fxTexGetInfo(tObj->Image[minl]->Width,tObj->Image[minl]->Height, &(FX_largeLodLog2(ti->info)),&(FX_aspectRatioLog2(ti->info)), &(ti->sScale),&(ti->tScale), &(ti->int_sScale),&(ti->int_tScale), NULL,NULL); - if((tObj->MinFilter!=GL_NEAREST) && (tObj->MinFilter!=GL_LINEAR)) fxTexGetInfo(tObj->Image[maxl]->Width,tObj->Image[maxl]->Height, &(FX_smallLodLog2(ti->info)),NULL, @@ -292,6 +292,7 @@ static void fxSetupSingleTMU(fxMesaContext fxMesa, struct gl_texture_object *tOb if (ti->LODblend && (MESA_VERBOSE&VERBOSE_DRIVER)) fprintf(stderr, "fxmesa: not blending texture - only on one tmu\n"); + grTexClampMode(ti->tmi.whichTMU,ti->sClamp,ti->tClamp); grTexFilterMode(ti->tmi.whichTMU,ti->minFilt,ti->maxFilt); grTexMipMapMode(ti->tmi.whichTMU,ti->mmMode,FXFALSE); @@ -356,9 +357,9 @@ void fxSetupTextureSingleTMU(GLcontext *ctx, GLuint textureset) tfxTexInfo *ti; struct gl_texture_object *tObj=ctx->Texture.Unit[textureset].CurrentD[2]; - if (MESA_VERBOSE&VERBOSE_DRIVER) { + if (MESA_VERBOSE&VERBOSE_DRIVER) fprintf(stderr,"fxmesa: fxSetupTextureSingleTMU(...) Start\n"); - } + ti=(tfxTexInfo *)tObj->DriverData; @@ -1559,9 +1560,11 @@ void fxSetupFXUnits( GLcontext *ctx ) fxMesaContext fxMesa=(fxMesaContext)ctx->DriverCtx; GLuint newstate = fxMesa->new_state; + if (MESA_VERBOSE&VERBOSE_DRIVER) gl_print_fx_state_flags("fxmesa: fxSetupFXUnits", newstate); + if (newstate) { if (newstate & FX_NEW_TEXTURING) fxSetupTexture(ctx); @@ -1588,7 +1591,7 @@ void fxSetupFXUnits( GLcontext *ctx ) fxSetupCull(ctx); fxMesa->new_state = 0; - ctx->Driver.RenderStart = 0; +/* ctx->Driver.RenderStart = 0; */ } } |