radeonsi: correctly mark levels of 3D textures as fully decompressed
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Fri, 1 Jul 2016 09:37:59 +0000 (11:37 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Jul 2016 08:42:49 +0000 (10:42 +0200)
Account for the fact that max_layer is minified for higher levels.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_blit.c

index a48c5bc19e13adbb1a68b9a0bb360f7e058ed3f6..114878738ba5c9d4db8a22c5270b7783ba1c0cd2 100644 (file)
@@ -214,7 +214,7 @@ si_blit_decompress_zs_planes_in_place(struct si_context *sctx,
 
                /* The texture will always be dirty if some layers aren't flushed.
                 * I don't think this case occurs often though. */
-               if (first_layer == 0 && last_layer == max_layer) {
+               if (first_layer == 0 && last_layer >= max_layer) {
                        fully_decompressed_mask |= 1u << level;
                }
        }
@@ -361,7 +361,7 @@ static void si_blit_decompress_color(struct pipe_context *ctx,
 
                /* The texture will always be dirty if some layers aren't flushed.
                 * I don't think this case occurs often though. */
-               if (first_layer == 0 && last_layer == max_layer) {
+               if (first_layer == 0 && last_layer >= max_layer) {
                        rtex->dirty_level_mask &= ~(1 << level);
                }
        }