summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-08-17 12:17:31 +1000
committerAlex Deucher <alexdeucher@gmail.com>2009-08-17 13:22:53 -0400
commitdc9799c94c7f2c7f16e09de03376936e24b4e17f (patch)
tree7aef865ed11d43233b0e1fa889e40e4af7ae2c0e
parentc71efd81b070fc9fee862dce02391e42b6524405 (diff)
r100/r200: dont emit wrong clamp modes.
for rect textures you don't want to use wrap clamping which is the default.
-rw-r--r--src/radeon_exa_render.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/radeon_exa_render.c b/src/radeon_exa_render.c
index 65197c02..8e98b9fd 100644
--- a/src/radeon_exa_render.c
+++ b/src/radeon_exa_render.c
@@ -409,8 +409,7 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
RADEON_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
- if (repeat) {
- switch (pPict->repeatType) {
+ switch (pPict->repeatType) {
case RepeatNormal:
txfilter |= RADEON_CLAMP_S_WRAP | RADEON_CLAMP_T_WRAP;
break;
@@ -421,9 +420,10 @@ static Bool FUNC_NAME(R100TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
txfilter |= RADEON_CLAMP_S_MIRROR | RADEON_CLAMP_T_MIRROR;
break;
case RepeatNone:
- /* Nothing to do */
+ /* don't set an illegal clamp mode for rects */
+ if (txformat & RADEON_TXFORMAT_NON_POWER2)
+ txfilter |= RADEON_CLAMP_S_CLAMP_LAST | RADEON_CLAMP_T_CLAMP_LAST;
break;
- }
}
BEGIN_ACCEL(5);
@@ -747,8 +747,7 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
RADEON_FALLBACK(("Bad filter 0x%x\n", pPict->filter));
}
- if (repeat) {
- switch (pPict->repeatType) {
+ switch (pPict->repeatType) {
case RepeatNormal:
txfilter |= R200_CLAMP_S_WRAP | R200_CLAMP_T_WRAP;
break;
@@ -759,9 +758,10 @@ static Bool FUNC_NAME(R200TextureSetup)(PicturePtr pPict, PixmapPtr pPix,
txfilter |= R200_CLAMP_S_MIRROR | R200_CLAMP_T_MIRROR;
break;
case RepeatNone:
- /* Nothing to do */
+ /* don't set an illegal clamp mode for rect textures */
+ if (txformat & R200_TXFORMAT_NON_POWER2)
+ txfilter |= R200_CLAMP_S_CLAMP_LAST | R200_CLAMP_T_CLAMP_LAST;
break;
- }
}
BEGIN_ACCEL(6);