r300g: use a simpler fallback for misaligned ushort indices with triangles
[mesa.git] / src / gallium / drivers / r300 / r300_texture.c
index 70fc5d96d83689b48c3adfaa312c6a94349a8ffb..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:
@@ -481,6 +486,8 @@ static uint32_t r300_translate_out_fmt(enum pipe_format format)
     } else {
         if (desc->channel[i].size == 16) {
             modifier |= R300_US_OUT_FMT_C4_16;
+        } else if (desc->channel[i].size == 10) {
+            modifier |= R300_US_OUT_FMT_C4_10;
         } else {
             /* C4_8 seems to be used for the formats whose pixel size
              * is <= 32 bits. */
@@ -899,7 +906,7 @@ struct pipe_surface* r300_create_surface(struct pipe_context * ctx,
                                                tex->desc.b.b.nr_samples,
                                                tex->desc.microtile,
                                                tex->desc.macrotile[level],
-                                               DIM_HEIGHT);
+                                               DIM_HEIGHT, 0);
 
         surface->cbzb_height = align((surface->base.height + 1) / 2,
                                      tile_height);