r300g: explicit sign bits on RGTC textures
authorDave Airlie <airlied@redhat.com>
Thu, 24 Feb 2011 23:14:53 +0000 (09:14 +1000)
committerDave Airlie <airlied@redhat.com>
Thu, 24 Feb 2011 23:18:41 +0000 (09:18 +1000)
src/gallium/drivers/r300/r300_texture.c

index 354144cac79948673b4a0221f0062c8aeadc2e42..2db5ab9a287a47e4e3cc196f634e29d51361411a 100644 (file)
@@ -214,11 +214,13 @@ uint32_t r300_translate_texformat(enum pipe_format format,
     /* RGTC formats. */
     if (desc->layout == UTIL_FORMAT_LAYOUT_RGTC) {
         switch (format) {
-            case PIPE_FORMAT_RGTC1_UNORM:
             case PIPE_FORMAT_RGTC1_SNORM:
+                result |= sign_bit[0];
+            case PIPE_FORMAT_RGTC1_UNORM:
                 return R500_TX_FORMAT_ATI1N | result;
-            case PIPE_FORMAT_RGTC2_UNORM:
             case PIPE_FORMAT_RGTC2_SNORM:
+                result |= sign_bit[0] | sign_bit[1];
+            case PIPE_FORMAT_RGTC2_UNORM:
                 return R400_TX_FORMAT_ATI2N | result;
             default:
                 return ~0; /* Unsupported/unknown. */