summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2005-01-12 17:20:29 +0000
committerKeith Whitwell <[email protected]>2005-01-12 17:20:29 +0000
commit708e25142b0ce7b01028613481dc43f1e628786b (patch)
tree678c6da5a5722ce018adaee0e16c60206b03de8d /src/mesa/drivers
parent5ba7d85fea3c3fc687fbd309226a894077afb91c (diff)
Add flag to clear texture caches after texture upload.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/unichrome/via_context.h1
-rw-r--r--src/mesa/drivers/dri/unichrome/via_state.c50
-rw-r--r--src/mesa/drivers/dri/unichrome/via_texmem.c1
3 files changed, 18 insertions, 34 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_context.h b/src/mesa/drivers/dri/unichrome/via_context.h
index ae3b41506dd..e6140e21d05 100644
--- a/src/mesa/drivers/dri/unichrome/via_context.h
+++ b/src/mesa/drivers/dri/unichrome/via_context.h
@@ -286,6 +286,7 @@ struct via_context_t {
GLuint agpFullCount;
GLboolean strictConformance;
+ GLboolean clearTexCache;
/* Configuration cache
*/
diff --git a/src/mesa/drivers/dri/unichrome/via_state.c b/src/mesa/drivers/dri/unichrome/via_state.c
index 7aac5a2991d..06ba531265b 100644
--- a/src/mesa/drivers/dri/unichrome/via_state.c
+++ b/src/mesa/drivers/dri/unichrome/via_state.c
@@ -198,30 +198,24 @@ void viaEmitState(viaContextPtr vmesa)
if (VIA_DEBUG) fprintf(stderr, "multi texture\n");
nDummyValue = (HC_SubA_HTXSMD << 24) | (1 << 3);
- /* Clear cache flag never set:
- */
- if (0) {
- OUT_RING( nDummyValue | HC_HTXCHCLR_MASK );
- OUT_RING( nDummyValue );
- }
- else {
- OUT_RING( nDummyValue );
- OUT_RING( nDummyValue );
- }
}
else {
if (VIA_DEBUG) fprintf(stderr, "single texture\n");
nDummyValue = (HC_SubA_HTXSMD << 24) | 0;
-
- if (0) {
- OUT_RING( nDummyValue | HC_HTXCHCLR_MASK );
- OUT_RING( nDummyValue );
- }
- else {
- OUT_RING( nDummyValue );
- OUT_RING( nDummyValue );
- }
}
+
+ /* Clear cache flag never set:
+ */
+ if (vmesa->clearTexCache) {
+ vmesa->clearTexCache = 0;
+ OUT_RING( nDummyValue | HC_HTXCHCLR_MASK );
+ OUT_RING( nDummyValue );
+ }
+ else {
+ OUT_RING( nDummyValue );
+ OUT_RING( nDummyValue );
+ }
+
OUT_RING( HC_HEADER2 );
OUT_RING( HC_ParaType_NotTex << 16 );
OUT_RING( (HC_SubA_HEnable << 24) | vmesa->regEnable );
@@ -1318,6 +1312,9 @@ static void viaChooseColorState(GLcontext *ctx)
}
}
+
+ vmesa->regEnable &= ~HC_HenDT_MASK;
+
if (ctx->Color.ColorLogicOpEnabled)
vmesa->regHROP = ROP[ctx->Color.LogicOp & 0xF];
else
@@ -1616,21 +1613,6 @@ void viaValidateState( GLcontext *ctx )
else
vmesa->regEnable &= ~HC_HenCS_MASK;
- /* CLE266 gets this wrong at least: Pixels which fail alpha test
- * are incorrectly writen to the z buffer. This is a pretty big
- * slowdown, it would be good to find out this wasn't necessary:
- */
-#if 0
- /* Disabling now, as the main problem was that the alpha reference
- * value was calculated incorrectly, it's now fixed. */
- if (vmesa->viaScreen->deviceID == VIA_CLE266) {
- GLboolean fallback = (ctx->Color.AlphaEnabled &&
- ctx->Color.AlphaFunc != GL_ALWAYS &&
- ctx->Depth.Mask);
- FALLBACK( vmesa, VIA_FALLBACK_ALPHATEST, fallback );
- }
-#endif
-
vmesa->newEmitState |= vmesa->newState;
vmesa->newState = 0;
}
diff --git a/src/mesa/drivers/dri/unichrome/via_texmem.c b/src/mesa/drivers/dri/unichrome/via_texmem.c
index 3d0ff920f35..78153f68177 100644
--- a/src/mesa/drivers/dri/unichrome/via_texmem.c
+++ b/src/mesa/drivers/dri/unichrome/via_texmem.c
@@ -446,6 +446,7 @@ void viaUploadTexImages(viaContextPtr vmesa, viaTextureObjectPtr t)
viaUploadTexLevel(t, i);
t->dirtyImages = 0;
+ vmesa->clearTexCache = 1;
UNLOCK_HARDWARE(vmesa);
if (VIA_DEBUG) fprintf(stderr, "%s - out\n", __FUNCTION__);