r300g: add support for B2G3R3 texturing
authorMarek Olšák <maraeo@gmail.com>
Wed, 22 Dec 2010 12:28:55 +0000 (13:28 +0100)
committerMarek Olšák <maraeo@gmail.com>
Thu, 23 Dec 2010 15:54:59 +0000 (16:54 +0100)
src/gallium/drivers/r300/r300_state_derived.c
src/gallium/drivers/r300/r300_texture.c

index d5fc8ece252923bedc244619e00dc4df1d44c1d0..d3985c11aa8fc2d2127374969bd268f646566238 100644 (file)
@@ -645,6 +645,10 @@ static uint32_t r300_get_border_color(enum pipe_format format,
     }
 
     switch (desc->channel[0].size) {
+        case 2:
+            util_pack_color(border_swizzled, PIPE_FORMAT_B2G3R3_UNORM, &uc);
+            break;
+
         case 4:
             util_pack_color(border_swizzled, PIPE_FORMAT_B4G4R4A4_UNORM, &uc);
             break;
index 24f1d68f4a75c6cae96b78bad47fd7fc1d82175b..6fdc504ed5401b8f48176f962b6a95cb351f79c5 100644 (file)
@@ -244,6 +244,11 @@ uint32_t r300_translate_texformat(enum pipe_format format,
                     desc->channel[2].size == 6) {
                     return R300_TX_FORMAT_Z6Y5X5 | result;
                 }
+                if (desc->channel[0].size == 2 &&
+                    desc->channel[1].size == 3 &&
+                    desc->channel[2].size == 3) {
+                    return R300_TX_FORMAT_Z3Y3X2 | result;
+                }
                 return ~0; /* Unsupported/unknown. */
 
             case 4: