diff options
author | Rob Clark <[email protected]> | 2017-05-15 12:36:24 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-05-16 16:34:21 -0400 |
commit | 9235ab65505657a81f98509b0a01688e9c630d39 (patch) | |
tree | b3ce973e945b76050b7ac5b08b82b3a5b634a634 /src/gallium/drivers/freedreno/a5xx/fd5_draw.c | |
parent | cb16d9103480687c414519bed5256217c9e7aaad (diff) |
freedreno/a5xx: fallback to slow-clear for z32
We probably *could* do this with blit path, but I think it would involve
clobbering settings from batch->gmem (see emit_zs()).
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a5xx/fd5_draw.c')
-rw-r--r-- | src/gallium/drivers/freedreno/a5xx/fd5_draw.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/gallium/drivers/freedreno/a5xx/fd5_draw.c b/src/gallium/drivers/freedreno/a5xx/fd5_draw.c index cd315d4ac04..bc5232a4c17 100644 --- a/src/gallium/drivers/freedreno/a5xx/fd5_draw.c +++ b/src/gallium/drivers/freedreno/a5xx/fd5_draw.c @@ -162,7 +162,19 @@ fd5_draw_vbo(struct fd_context *ctx, const struct pipe_draw_info *info, return true; } -static void +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 fd5_clear(struct fd_context *ctx, unsigned buffers, const union pipe_color_union *color, double depth, unsigned stencil) { @@ -170,6 +182,10 @@ fd5_clear(struct fd_context *ctx, unsigned buffers, struct pipe_framebuffer_state *pfb = &ctx->batch->framebuffer; struct pipe_scissor_state *scissor = fd_context_get_scissor(ctx); + if ((buffers & (PIPE_CLEAR_DEPTH | PIPE_CLEAR_STENCIL)) && + is_z32(pfb->zsbuf->format)) + return false; + /* TODO handle scissor.. or fallback to slow-clear? */ ctx->batch->max_scissor.minx = MIN2(ctx->batch->max_scissor.minx, scissor->minx); @@ -272,6 +288,8 @@ fd5_clear(struct fd_context *ctx, unsigned buffers, /* disable fast clear to not interfere w/ gmem->mem, etc.. */ OUT_PKT4(ring, REG_A5XX_RB_CLEAR_CNTL, 1); OUT_RING(ring, 0x00000000); /* RB_CLEAR_CNTL */ + + return true; } void |