On Fri, 2006-09-22 at 11:14 +0100, Keith Whitwell wrote:
> 
> Maybe enable for the paths that are well understood and tested, but 
> where it is still behaving contrary to expectations, leave it disabled. 
>     I'd say it is behaving as expected in the software mesa cases and 
> argb8888.

Our confusion might have to do with the fact I now discovered that the
hardware drivers only hit argb8888 and a8. :} Software Mesa also hits
rgb and rgba8888, which the attached patch fixes, so I think all these
make sense now. *phew*


On a possibly related note, software Mesa still seems to fail all
combinations with type GL_HALF_FLOAT_ARB here, apparently there's an
endianness issue somewhere in there as well.


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer
Index: src/mesa/main/texstore.c
===================================================================
RCS file: /cvs/mesa/Mesa/src/mesa/main/texstore.c,v
retrieving revision 1.131
diff -p -u -r1.131 texstore.c
--- src/mesa/main/texstore.c	21 Sep 2006 22:43:51 -0000	1.131
+++ src/mesa/main/texstore.c	22 Sep 2006 12:43:51 -0000
@@ -721,9 +725,9 @@ type_mapping( GLenum srcType )
    case GL_UNSIGNED_BYTE:
       return map_identity;
    case GL_UNSIGNED_INT_8_8_8_8:
-      return map_3210;
+      return _mesa_little_endian() ? map_3210 : map_identity;
    case GL_UNSIGNED_INT_8_8_8_8_REV:
-      return map_identity;
+      return _mesa_little_endian() ? map_identity : map_3210;
    default:
       return NULL;
    }
@@ -984,7 +990,6 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS)
       }
    }
    else if (!ctx->_ImageTransferState &&
-	    _mesa_little_endian() &&
 	    CHAN_TYPE == GL_UNSIGNED_BYTE &&
 	    (srcType == GL_UNSIGNED_BYTE ||
 	     srcType == GL_UNSIGNED_INT_8_8_8_8 ||
@@ -1314,7 +1319,6 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
                      srcAddr, srcPacking);
    }
    else if (!ctx->_ImageTransferState &&
-	    littleEndian && 
 	    (srcType == GL_UNSIGNED_BYTE ||
 	     srcType == GL_UNSIGNED_INT_8_8_8_8 ||
 	     srcType == GL_UNSIGNED_INT_8_8_8_8_REV) &&
@@ -1322,10 +1326,11 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
 	    can_swizzle(srcFormat)) {
 
       GLubyte dstmap[4];
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
-      if (dstFormat == &_mesa_texformat_rgba8888) {
+      if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) ||
+	  (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) {
 	 dstmap[3] = 0;
 	 dstmap[2] = 1;
 	 dstmap[1] = 2;
@@ -1529,7 +1534,6 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
       }
    }
    else if (!ctx->_ImageTransferState &&
-	    littleEndian &&
 	    (srcType == GL_UNSIGNED_BYTE ||
 	     srcType == GL_UNSIGNED_INT_8_8_8_8 ||
 	     srcType == GL_UNSIGNED_INT_8_8_8_8_REV) &&
@@ -1540,14 +1544,16 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS)
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
-      if (dstFormat == &_mesa_texformat_argb8888) {
+      if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) ||
+	  (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) {
 	 dstmap[3] = 3;		/* alpha */
 	 dstmap[2] = 0;		/* red */
 	 dstmap[1] = 1;		/* green */
 	 dstmap[0] = 2;		/* blue */
       }
       else {
-	 assert(dstFormat == &_mesa_texformat_argb8888_rev);
+	 assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) ||
+		(!littleEndian && dstFormat == &_mesa_texformat_argb8888));
 	 dstmap[3] = 2;
 	 dstmap[2] = 1;
 	 dstmap[1] = 0;
@@ -1662,13 +1668,12 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS)
       }
    }
    else if (!ctx->_ImageTransferState &&
-	    littleEndian &&
 	    srcType == GL_UNSIGNED_BYTE &&
 	    can_swizzle(baseInternalFormat) &&
 	    can_swizzle(srcFormat)) {
 
       GLubyte dstmap[4];
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
       dstmap[0] = 2;
@@ -1788,13 +1793,12 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS)
       }
    }
    else if (!ctx->_ImageTransferState &&
-	    littleEndian &&
 	    srcType == GL_UNSIGNED_BYTE &&
 	    can_swizzle(baseInternalFormat) &&
 	    can_swizzle(srcFormat)) {
 
       GLubyte dstmap[4];
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
       dstmap[0] = 0;
@@ -2014,10 +2018,11 @@ _mesa_texstore_al88(TEXSTORE_PARAMS)
 	    can_swizzle(srcFormat)) {
 
       GLubyte dstmap[4];
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
-      if (dstFormat == &_mesa_texformat_al88) {
+      if ((littleEndian && dstFormat == &_mesa_texformat_al88) ||
+	  (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) {
 	 dstmap[0] = 0;
 	 dstmap[1] = 3;
       }
@@ -2159,13 +2164,12 @@ _mesa_texstore_a8(TEXSTORE_PARAMS)
                      srcAddr, srcPacking);
    }
    else if (!ctx->_ImageTransferState &&
-	    _mesa_little_endian() &&
 	    srcType == GL_UNSIGNED_BYTE &&
 	    can_swizzle(baseInternalFormat) &&
 	    can_swizzle(srcFormat)) {
 
       GLubyte dstmap[4];
 
       /* dstmap - how to swizzle from RGBA to dst format:
        */
       if (dstFormat == &_mesa_texformat_a8) {
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to