r600g: enable fast depth clear for array textures and cubemaps
authorMarek Olšák <marek.olsak@amd.com>
Wed, 20 Aug 2014 12:36:53 +0000 (14:36 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 1 Sep 2014 19:18:37 +0000 (21:18 +0200)
I have a piglit test that hits this.

Acked-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/r600/r600_blit.c

index a3cfdae6b73c1cfd0bccfc56264de07125f8e388..0f438399432de89e4bc3fbea1ded82c61e0a6967 100644 (file)
@@ -429,7 +429,8 @@ static void r600_clear(struct pipe_context *ctx, unsigned buffers,
                 */
                /* Only use htile for first level */
                if (rtex->htile_buffer && !level &&
-                   util_max_layer(&rtex->resource.b.b, level) == 0) {
+                   fb->zsbuf->u.tex.first_layer == 0 &&
+                   fb->zsbuf->u.tex.last_layer == util_max_layer(&rtex->resource.b.b, level)) {
                        if (rtex->depth_clear_value != depth) {
                                rtex->depth_clear_value = depth;
                                rctx->db_state.atom.dirty = true;