freedreno/a6xx: disable LRZ for z32
authorRob Clark <robdclark@gmail.com>
Tue, 13 Nov 2018 19:49:25 +0000 (14:49 -0500)
committerRob Clark <robdclark@gmail.com>
Tue, 27 Nov 2018 20:44:02 +0000 (15:44 -0500)
f6131d4ec7a had the side effect of enabling LRZ w/ 32b depth buffers.
But there are some bugs with this, which aren't fully understood yet,
so for now just skip LRZ w/ z32..

Fixes: f6131d4ec7a freedreno/a6xx: Clear z32 and separate stencil with blitter
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gallium/drivers/freedreno/a6xx/fd6_draw.c

index adb045adbea90939e61609da78c33f097042d704..f98a7fc4b13f89f9e13747a391eda2667ad07a5c 100644 (file)
@@ -371,6 +371,18 @@ fd6_clear_lrz(struct fd_batch *batch, struct fd_resource *zsbuf, double depth)
        fd6_cache_flush(batch, ring);
 }
 
+static bool is_z32(enum pipe_format format)
+{
+       switch (format) {
+       case PIPE_FORMAT_Z32_FLOAT_S8X24_UINT:
+       case PIPE_FORMAT_Z32_UNORM:
+       case PIPE_FORMAT_Z32_FLOAT:
+               return true;
+       default:
+               return false;
+       }
+}
+
 static bool
 fd6_clear(struct fd_context *ctx, unsigned buffers,
                const union pipe_color_union *color, double depth, unsigned stencil)
@@ -398,7 +410,7 @@ fd6_clear(struct fd_context *ctx, unsigned buffers,
 
        if (has_depth && (buffers & PIPE_CLEAR_DEPTH)) {
                struct fd_resource *zsbuf = fd_resource(pfb->zsbuf->texture);
-               if (zsbuf->lrz) {
+               if (zsbuf->lrz && !is_z32(pfb->zsbuf->format)) {
                        zsbuf->lrz_valid = true;
                        fd6_clear_lrz(ctx->batch, zsbuf, depth);
                }