r300g: force swizzles for RGTC
authorDave Airlie <airlied@redhat.com>
Sun, 27 Feb 2011 07:00:50 +0000 (17:00 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 28 Feb 2011 03:21:44 +0000 (13:21 +1000)
still can't get signed to work

src/gallium/drivers/r300/r300_texture.c

index 2db5ab9a287a47e4e3cc196f634e29d51361411a..b97c45ac198fb651797c6efc06495fac79455553 100644 (file)
@@ -217,10 +217,15 @@ uint32_t r300_translate_texformat(enum pipe_format format,
             case PIPE_FORMAT_RGTC1_SNORM:
                 result |= sign_bit[0];
             case PIPE_FORMAT_RGTC1_UNORM:
+                result &= ~(0xfff << 9); /* mask off swizzle */
+                result |= R300_TX_FORMAT_Y << R300_TX_FORMAT_R_SHIFT;
                 return R500_TX_FORMAT_ATI1N | result;
             case PIPE_FORMAT_RGTC2_SNORM:
                 result |= sign_bit[0] | sign_bit[1];
             case PIPE_FORMAT_RGTC2_UNORM:
+                result &= ~(0xfff << 9); /* mask off swizzle */
+                result |= R300_TX_FORMAT_Y << R300_TX_FORMAT_R_SHIFT |
+                          R300_TX_FORMAT_X << R300_TX_FORMAT_G_SHIFT;
                 return R400_TX_FORMAT_ATI2N | result;
             default:
                 return ~0; /* Unsupported/unknown. */