r600g: enable fast MSAA color clear for array/3D/cube textures
authorMarek Olšák <maraeo@gmail.com>
Mon, 1 Jul 2013 00:29:50 +0000 (02:29 +0200)
committerMarek Olšák <maraeo@gmail.com>
Mon, 8 Jul 2013 18:25:18 +0000 (20:25 +0200)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/drivers/r600/r600_blit.c

index 3b8a28b7fe864c80094b54517bf0386f8ab17ef1..7a0e2561b854322032fa4240cfb8fdd1149e56ba 100644 (file)
@@ -447,7 +447,6 @@ static bool can_fast_clear_color(struct pipe_context *ctx)
 
        for (i = 0; i < fb->nr_cbufs; i++) {
                struct r600_texture *tex = (struct r600_texture *)fb->cbufs[i]->texture;
-               int target = fb->cbufs[i]->texture->target;
 
                if (tex->cmask_size == 0) {
                        return false;
@@ -458,9 +457,9 @@ static bool can_fast_clear_color(struct pipe_context *ctx)
                        return false;
                }
 
-               /* textures with multiple images are not supported */
-               if (target != PIPE_TEXTURE_2D && target != PIPE_TEXTURE_RECT &&
-                               target != PIPE_TEXTURE_1D) {
+               /* the clear is allowed if all layers are bound */
+               if (fb->cbufs[i]->u.tex.first_layer != 0 ||
+                   fb->cbufs[i]->u.tex.last_layer != util_max_layer(&tex->resource.b.b, 0)) {
                        return false;
                }
        }