r600: float texture component ordering
authorPierre Ossman <pierre@ossman.eu>
Wed, 6 Jan 2010 17:42:49 +0000 (12:42 -0500)
committerAlex Deucher <alexdeucher@gmail.com>
Wed, 6 Jan 2010 17:42:49 +0000 (12:42 -0500)
The ordering of texture components was
backwards for the floating point textures.

Signed-off-by: Pierre Ossman <pierre@ossman.eu>
src/mesa/drivers/dri/r600/r600_texstate.c

index 4ec315b78c7439a8f053bf96db3a3aeae4d1d19c..8ee2a10f25a76c74e6fafda44245935755ef8f77 100644 (file)
@@ -357,37 +357,37 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
                SETfield(t->SQ_TEX_RESOURCE1, FMT_32_32_32_32_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
-                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
                break;
        case MESA_FORMAT_RGBA_FLOAT16:
                SETfield(t->SQ_TEX_RESOURCE1, FMT_16_16_16_16_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
-                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
                break;
        case MESA_FORMAT_RGB_FLOAT32: /* X, Y, Z, ONE */
                SETfield(t->SQ_TEX_RESOURCE1, FMT_32_32_32_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
@@ -396,11 +396,11 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
                SETfield(t->SQ_TEX_RESOURCE1, FMT_16_16_16_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Z,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_1,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
@@ -461,26 +461,26 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa
                SETfield(t->SQ_TEX_RESOURCE1, FMT_32_32_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
-                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
                break;
        case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16:
                SETfield(t->SQ_TEX_RESOURCE1, FMT_16_16_FLOAT,
                         SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask);
 
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_X_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask);
-               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
-                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
                SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X,
+                        SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask);
+               SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_Y,
                         SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask);
                break;
        case MESA_FORMAT_INTENSITY_FLOAT32: /* X, X, X, X */