freedreno: Move blend gmem checks to a blend dirty state check.

We don't need to do this every draw call.  We do now consider the blend
enable field of a non-present color buffer, because it's not worth
filtering that case out.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8602>
This commit is contained in:
Eric Anholt 2021-01-22 10:24:40 -08:00 committed by Marge Bot
parent e4e46f2c4c
commit 6e29757a57
2 changed files with 9 additions and 15 deletions

View File

@ -105,8 +105,6 @@ batch_draw_tracking(struct fd_batch *batch, const struct pipe_draw_info *info,
}
}
if (fd_logicop_enabled(ctx))
batch->gmem_reason |= FD_GMEM_LOGICOP_ENABLED;
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
struct pipe_resource *surf;
@ -124,13 +122,19 @@ batch_draw_tracking(struct fd_batch *batch, const struct pipe_draw_info *info,
buffers |= PIPE_CLEAR_COLOR0 << i;
if (fd_blend_enabled(ctx, i))
batch->gmem_reason |= FD_GMEM_BLEND_ENABLED;
if (ctx->dirty & FD_DIRTY_FRAMEBUFFER)
resource_written(batch, pfb->cbufs[i]->texture);
}
if (ctx->dirty & FD_DIRTY_BLEND) {
if (ctx->blend->logicop_enable)
batch->gmem_reason |= FD_GMEM_LOGICOP_ENABLED;
for (unsigned i = 0; i < pfb->nr_cbufs; i++) {
if (ctx->blend->rt[i].blend_enable)
batch->gmem_reason |= FD_GMEM_BLEND_ENABLED;
}
}
/* Mark SSBOs */
if (ctx->dirty_shader[PIPE_SHADER_FRAGMENT] & FD_DIRTY_SHADER_SSBO) {
const struct fd_shaderbuf_stateobj *so = &ctx->shaderbuf[PIPE_SHADER_FRAGMENT];

View File

@ -45,16 +45,6 @@ static inline bool fd_stencil_enabled(struct fd_context *ctx)
return ctx->zsa && ctx->zsa->stencil[0].enabled;
}
static inline bool fd_logicop_enabled(struct fd_context *ctx)
{
return ctx->blend && ctx->blend->logicop_enable;
}
static inline bool fd_blend_enabled(struct fd_context *ctx, unsigned n)
{
return ctx->blend && ctx->blend->rt[n].blend_enable;
}
static inline bool fd_depth_clamp_enabled(struct fd_context *ctx)
{
return !(ctx->rasterizer->depth_clip_near && ctx->rasterizer->depth_clip_far);