mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
freedreno/a6xx: LRZ for MSAA
We don't need to fall off the LRZ path when we fall back to clearing depth with a u_blitter draw, since u_blitter uses zsa state to achieve the depth/stencil clear and this is entirely compabile with LRZ. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20975>
This commit is contained in:
parent
5eb85ef756
commit
951d963565
1 changed files with 13 additions and 13 deletions
|
|
@ -502,10 +502,6 @@ fd6_clear(struct fd_context *ctx, unsigned buffers,
|
|||
const bool has_depth = pfb->zsbuf;
|
||||
unsigned color_buffers = buffers >> 2;
|
||||
|
||||
/* we need to do multisample clear on 3d pipe, so fallback to u_blitter: */
|
||||
if (pfb->samples > 1)
|
||||
return false;
|
||||
|
||||
/* If we're clearing after draws, fallback to 3D pipe clears. We could
|
||||
* use blitter clears in the draw batch but then we'd have to patch up the
|
||||
* gmem offsets. This doesn't seem like a useful thing to optimize for
|
||||
|
|
@ -513,6 +509,19 @@ fd6_clear(struct fd_context *ctx, unsigned buffers,
|
|||
if (ctx->batch->num_draws > 0)
|
||||
return false;
|
||||
|
||||
if (has_depth && (buffers & PIPE_CLEAR_DEPTH)) {
|
||||
struct fd_resource *zsbuf = fd_resource(pfb->zsbuf->texture);
|
||||
if (zsbuf->lrz && !is_z32(pfb->zsbuf->format)) {
|
||||
zsbuf->lrz_valid = true;
|
||||
zsbuf->lrz_direction = FD_LRZ_UNKNOWN;
|
||||
fd6_clear_lrz(ctx->batch, zsbuf, depth);
|
||||
}
|
||||
}
|
||||
|
||||
/* we need to do multisample clear on 3d pipe, so fallback to u_blitter: */
|
||||
if (pfb->samples > 1)
|
||||
return false;
|
||||
|
||||
u_foreach_bit (i, color_buffers)
|
||||
ctx->batch->clear_color[i] = *color;
|
||||
if (buffers & PIPE_CLEAR_DEPTH)
|
||||
|
|
@ -522,15 +531,6 @@ fd6_clear(struct fd_context *ctx, unsigned buffers,
|
|||
|
||||
ctx->batch->fast_cleared |= buffers;
|
||||
|
||||
if (has_depth && (buffers & PIPE_CLEAR_DEPTH)) {
|
||||
struct fd_resource *zsbuf = fd_resource(pfb->zsbuf->texture);
|
||||
if (zsbuf->lrz && !is_z32(pfb->zsbuf->format)) {
|
||||
zsbuf->lrz_valid = true;
|
||||
zsbuf->lrz_direction = FD_LRZ_UNKNOWN;
|
||||
fd6_clear_lrz(ctx->batch, zsbuf, depth);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue