diff options
author | Felix Kuehling <[email protected]> | 2005-03-23 17:59:09 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2005-03-23 17:59:09 +0000 |
commit | 798e753e072822781e57febe8bf58257deb03565 (patch) | |
tree | 0d1c0125512836887d5bc0e253f2a4dfc392c55f /src/mesa/drivers/dri/savage | |
parent | ce1d7ee5ee482c05bbd4196d946590cdb93d8354 (diff) |
Initialize texture addresses to something valid.
Diffstat (limited to 'src/mesa/drivers/dri/savage')
-rw-r--r-- | src/mesa/drivers/dri/savage/savagestate.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/savage/savagestate.c b/src/mesa/drivers/dri/savage/savagestate.c index dd143f0949d..6633c4e4764 100644 --- a/src/mesa/drivers/dri/savage/savagestate.c +++ b/src/mesa/drivers/dri/savage/savagestate.c @@ -1556,6 +1556,17 @@ static void savageDDInitState_s4( savageContextPtr imesa ) imesa->regs.s4.texCtrl[1].ni.texXprEn = GL_TRUE; imesa->regs.s4.texCtrl[0].ni.dMax = 0x0f; imesa->regs.s4.texCtrl[1].ni.dMax = 0x0f; + /* programm a valid tex address, in case texture state is emitted + * in wrong order. */ + if (imesa->lastTexHeap == 2 && imesa->savageScreen->textureSize[1]) { + /* AGP textures available */ + imesa->regs.s4.texAddr[0].ui = imesa->savageScreen->textureOffset[1]|3; + imesa->regs.s4.texAddr[1].ui = imesa->savageScreen->textureOffset[1]|3; + } else { + /* no AGP textures available, use local */ + imesa->regs.s4.texAddr[0].ui = imesa->savageScreen->textureOffset[0]|2; + imesa->regs.s4.texAddr[1].ui = imesa->savageScreen->textureOffset[0]|2; + } imesa->regs.s4.drawLocalCtrl.ni.drawUpdateEn = GL_TRUE; imesa->regs.s4.drawLocalCtrl.ni.srcAlphaMode = SAM_One; imesa->regs.s4.drawLocalCtrl.ni.wrZafterAlphaTst = GL_FALSE; @@ -1621,6 +1632,15 @@ static void savageDDInitState_s3d( savageContextPtr imesa ) imesa->regs.s3d.texCtrl.ni.dBias = 0x08; imesa->regs.s3d.texCtrl.ni.texXprEn = GL_TRUE; + /* programm a valid tex address, in case texture state is emitted + * in wrong order. */ + if (imesa->lastTexHeap == 2 && imesa->savageScreen->textureSize[1]) { + /* AGP textures available */ + imesa->regs.s3d.texAddr.ui = imesa->savageScreen->textureOffset[1]|3; + } else { + /* no AGP textures available, use local */ + imesa->regs.s3d.texAddr.ui = imesa->savageScreen->textureOffset[0]|2; + } imesa->regs.s3d.zBufCtrl.ni.drawUpdateEn = GL_TRUE; imesa->regs.s3d.zBufCtrl.ni.wrZafterAlphaTst = GL_FALSE; |