From 27d9664f8862d1948dd32021f8e9bcb94f23e4ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Thu, 27 Aug 2009 09:52:10 +0200 Subject: EXA: RENDER repeat cleanups. We can't rely on the server setting pPict->repeatType to something sensible when pPict->repeat is FALSE, but we can do it ourselves. --- src/r600_exa.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'src/r600_exa.c') diff --git a/src/r600_exa.c b/src/r600_exa.c index 3e775157..57867f1b 100644 --- a/src/r600_exa.c +++ b/src/r600_exa.c @@ -1258,30 +1258,29 @@ static Bool R600TextureSetup(PicturePtr pPict, PixmapPtr pPix, tex_samp.id = unit; tex_samp.border_color = SQ_TEX_BORDER_COLOR_TRANS_BLACK; - if (pPict->repeat) { - switch (pPict->repeatType) { - case RepeatNormal: - tex_samp.clamp_x = SQ_TEX_WRAP; - tex_samp.clamp_y = SQ_TEX_WRAP; - break; - case RepeatPad: - tex_samp.clamp_x = SQ_TEX_CLAMP_LAST_TEXEL; - tex_samp.clamp_y = SQ_TEX_CLAMP_LAST_TEXEL; - break; - case RepeatReflect: - tex_samp.clamp_x = SQ_TEX_MIRROR; - tex_samp.clamp_y = SQ_TEX_MIRROR; - break; - case RepeatNone: - tex_samp.clamp_x = SQ_TEX_CLAMP_BORDER; - tex_samp.clamp_y = SQ_TEX_CLAMP_BORDER; - break; - default: - RADEON_FALLBACK(("Bad repeat 0x%x\n", pPict->repeatType)); - } - } else { + /* Unfortunately we can't rely on the X server doing this for us */ + if (!pPict->repeat) + pPict->repeatType = RepeatNone; + + switch (pPict->repeatType) { + case RepeatNormal: + tex_samp.clamp_x = SQ_TEX_WRAP; + tex_samp.clamp_y = SQ_TEX_WRAP; + break; + case RepeatPad: + tex_samp.clamp_x = SQ_TEX_CLAMP_LAST_TEXEL; + tex_samp.clamp_y = SQ_TEX_CLAMP_LAST_TEXEL; + break; + case RepeatReflect: + tex_samp.clamp_x = SQ_TEX_MIRROR; + tex_samp.clamp_y = SQ_TEX_MIRROR; + break; + case RepeatNone: tex_samp.clamp_x = SQ_TEX_CLAMP_BORDER; tex_samp.clamp_y = SQ_TEX_CLAMP_BORDER; + break; + default: + RADEON_FALLBACK(("Bad repeat 0x%x\n", pPict->repeatType)); } switch (pPict->filter) { -- cgit v1.2.3