summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200/r200_texmem.c
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger@gmx.ch>2006-09-20 19:11:56 +0000
committerRoland Scheidegger <rscheidegger@gmx.ch>2006-09-20 19:11:56 +0000
commit62d4dfbfe3f7c452f3c182bfdb9270a2f20e3f2d (patch)
tree2d4798e3555cc39f4ba82fb2293b3d2a3f664658 /src/mesa/drivers/dri/r200/r200_texmem.c
parent46c3bd29be4970a8b0c1c358aae0f1d7c05bc9f4 (diff)
try to use a 8888 texture format which will result in only a memcopy in mesa's texstore functions whenever possible for r200 and r300. r200 can use hw formats argb8888, rgba8888 and abgr8888 (or the opposite on big endian), r300 can use argb8888, bgra8888, rgba8888 and abgr8888 regardless of endian, as it supports free component swizzling.
Diffstat (limited to 'src/mesa/drivers/dri/r200/r200_texmem.c')
-rw-r--r--src/mesa/drivers/dri/r200/r200_texmem.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_texmem.c b/src/mesa/drivers/dri/r200/r200_texmem.c
index 14ee8238ad..28988c9755 100644
--- a/src/mesa/drivers/dri/r200/r200_texmem.c
+++ b/src/mesa/drivers/dri/r200/r200_texmem.c
@@ -374,6 +374,10 @@ static void uploadSubImage( r200ContextPtr rmesa, r200TexObjPtr t,
tex.height = imageHeight;
tex.width = imageWidth;
tex.format = t->pp_txformat & R200_TXFORMAT_FORMAT_MASK;
+ if (tex.format == R200_TXFORMAT_ABGR8888) {
+ /* drm will refuse abgr8888 textures. */
+ tex.format = R200_TXFORMAT_ARGB8888;
+ }
tex.pitch = MAX2((texImage->Width * texImage->TexFormat->TexelBytes) / 64, 1);
tex.offset += tmp.x & ~1023;
tmp.x = tmp.x % 1024;