st/xa: Solid fill (tested) and composite (yet untested)
[mesa.git] / src / gallium / drivers / r600 / r600_texture.c
index f527c07adcdb548339e51af6f6afd92398644ea8..470d26e2c9f47d4dff0fca401f867fd81a939cae 100644 (file)
@@ -68,7 +68,7 @@ static void r600_copy_from_staging_texture(struct pipe_context *ctx, struct r600
                                  rtransfer->staging_texture,
                                  0, &sbox);
 
-       ctx->flush(ctx, 0, NULL);
+        ctx->flush(ctx, NULL);
 }
 
 unsigned r600_texture_get_offset(struct r600_resource_texture *rtex,
@@ -405,10 +405,12 @@ struct pipe_resource *r600_texture_create(struct pipe_screen *screen,
        /* Would like some magic "get_bool_option_once" routine.
         */
        if (force_tiling == -1) {
-               struct r600_screen *rscreen = (struct r600_screen *)screen;
+#if 0
                /* reenable when 2D tiling is fixed better */
-               /*if (r600_get_minor_version(rscreen->radeon) >= 9)
-                       force_tiling = debug_get_bool_option("R600_TILING", TRUE);*/
+               struct r600_screen *rscreen = (struct r600_screen *)screen;
+               if (r600_get_minor_version(rscreen->radeon) >= 9)
+                       force_tiling = debug_get_bool_option("R600_TILING", TRUE);
+#endif
                force_tiling = debug_get_bool_option("R600_TILING", FALSE);
        }
 
@@ -635,7 +637,7 @@ struct pipe_transfer* r600_texture_get_transfer(struct pipe_context *ctx,
                if (usage & PIPE_TRANSFER_READ) {
                        r600_copy_to_staging_texture(ctx, trans);
                        /* Always referenced in the blit. */
-                       ctx->flush(ctx, 0, NULL);
+                        ctx->flush(ctx, NULL);
                }
                return &trans->transfer;
        }
@@ -881,13 +883,17 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
 
                switch (format) {
                case PIPE_FORMAT_RGTC1_SNORM:
+               case PIPE_FORMAT_LATC1_SNORM:
                        word4 |= sign_bit[0];
                case PIPE_FORMAT_RGTC1_UNORM:
+               case PIPE_FORMAT_LATC1_UNORM:
                        result = FMT_BC4;
                        goto out_word4;
                case PIPE_FORMAT_RGTC2_SNORM:
+               case PIPE_FORMAT_LATC2_SNORM:
                        word4 |= sign_bit[0] | sign_bit[1];
                case PIPE_FORMAT_RGTC2_UNORM:
+               case PIPE_FORMAT_LATC2_UNORM:
                        result = FMT_BC5;
                        goto out_word4;
                default:
@@ -924,6 +930,14 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
                }
        }
 
+       if (format == PIPE_FORMAT_R9G9B9E5_FLOAT) {
+               result = FMT_5_9_9_9_SHAREDEXP;
+               goto out_word4;
+       } else if (format == PIPE_FORMAT_R11G11B10_FLOAT) {
+               result = FMT_10_11_11_FLOAT;
+               goto out_word4;
+       }
+
 
        for (i = 0; i < desc->nr_channels; i++) {
                if (desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED) {
@@ -1068,8 +1082,9 @@ uint32_t r600_translate_texformat(struct pipe_screen *screen,
                                goto out_word4;
                        }
                }
-
+               goto out_unknown;
        }
+
 out_word4:
        if (word4_p)
                *word4_p = word4;
@@ -1077,6 +1092,6 @@ out_word4:
                *yuv_format_p = yuv_format;
        return result;
 out_unknown:
-//     R600_ERR("Unable to handle texformat %d %s\n", format, util_format_name(format));
+       /* R600_ERR("Unable to handle texformat %d %s\n", format, util_format_name(format)); */
        return ~0;
 }