summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorFelix Kuehling <[email protected]>2005-03-09 15:28:47 +0000
committerFelix Kuehling <[email protected]>2005-03-09 15:28:47 +0000
commit746df5671789aa5338c82a8e1b7fb50d342198e0 (patch)
treeea5b0da92447a1cf1672194f1650f6bb5b86dfd2 /src/mesa/drivers
parent5737fda093f8e1f4daabda3d55762dc7c4fe8ed9 (diff)
If the texture image changed force emitting the texture address, even
if it didn't change. This seems to flush texture cashes. Fixes multi-textured lighting in quake2.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/savage/savagestate.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c
index fd3da8262e7..dd143f0949d 100644
--- a/src/mesa/drivers/dri/savage/savagestate.c
+++ b/src/mesa/drivers/dri/savage/savagestate.c
@@ -1445,8 +1445,16 @@ static void savageEmitChangedRegChunk (savageContextPtr imesa,
}
static void savageUpdateRegister_s4(savageContextPtr imesa)
{
- /* the savage4 uses the contiguous range of BCI registers 0x1e-0x39
- * 0x1e-0x27 are local, no need to check them for global changes */
+ /* In case the texture image was changed without changing the
+ * texture address as well, we need to force emitting the texture
+ * address in order to flush texture cashes. */
+ if ((imesa->dirty & SAVAGE_UPLOAD_TEX0) &&
+ imesa->oldRegs.s4.texAddr[0].ui == imesa->regs.s4.texAddr[0].ui)
+ imesa->oldRegs.s4.texAddr[0].ui = 0xffffffff;
+ if ((imesa->dirty & SAVAGE_UPLOAD_TEX1) &&
+ imesa->oldRegs.s4.texAddr[1].ui == imesa->regs.s4.texAddr[1].ui)
+ imesa->oldRegs.s4.texAddr[1].ui = 0xffffffff;
+
savageEmitChangedRegs (imesa, 0x1e, 0x39);
imesa->dirty=0;