Commit dae5e1bc authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig Committed by Marge Bot
Browse files

panfrost: Dirty track batch masks

Since 5d187e9c

 ("panfrost: Add helpers to set batch masks"), we have common
helpers to set the colour and depth/stencil batch masks. Rather than set the
masks in various Midgard/Bifrost specific paths, set them generically based on
the finer dirty tracking. This lets us share the logic with Valhall.
Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa@collabora.com>
Part-of: <!15956>
parent c4167e89
Pipeline #561277 waiting for manual action with stages
......@@ -65,9 +65,6 @@ struct panfrost_zsa_state {
/* Is any depth, stencil, or alpha testing enabled? */
bool enabled;
/* Mask of PIPE_CLEAR_{DEPTH,STENCIL} written */
unsigned draws;
/* Prepacked words from the RSD */
struct mali_multisample_misc_packed rsd_depth;
struct mali_stencil_mask_misc_packed rsd_stencil;
......@@ -420,13 +417,6 @@ panfrost_emit_blend(struct panfrost_batch *batch, void *rts, mali_ptr *blend_sha
}
#endif
}
for (unsigned i = 0; i < batch->key.nr_cbufs; ++i) {
if (!so->info[i].no_colour && batch->key.cbufs[i]) {
batch->draws |= (PIPE_CLEAR_COLOR0 << i);
batch->resolve |= (PIPE_CLEAR_COLOR0 << i);
}
}
}
#endif
......@@ -670,17 +660,8 @@ panfrost_emit_frag_shader_meta(struct panfrost_batch *batch)
#if PAN_ARCH >= 5
panfrost_emit_blend(batch, xfer.cpu + pan_size(RENDERER_STATE), blend_shaders);
#else
batch->draws |= PIPE_CLEAR_COLOR0;
batch->resolve |= PIPE_CLEAR_COLOR0;
#endif
if (ctx->depth_stencil->base.depth_enabled)
batch->read |= PIPE_CLEAR_DEPTH;
if (ctx->depth_stencil->base.stencil[0].enabled)
batch->read |= PIPE_CLEAR_STENCIL;
return xfer.gpu;
}
#endif
......@@ -2971,6 +2952,12 @@ panfrost_update_state_3d(struct panfrost_batch *batch)
if (dirty & PAN_DIRTY_TLS_SIZE)
panfrost_batch_adjust_stack_size(batch);
if (dirty & PAN_DIRTY_BLEND)
panfrost_set_batch_masks_blend(batch);
if (dirty & PAN_DIRTY_ZS)
panfrost_set_batch_masks_zs(batch);
}
#if PAN_ARCH >= 6
......@@ -3468,10 +3455,6 @@ panfrost_draw_vbo(struct pipe_context *pipe,
return;
}
unsigned zs_draws = ctx->depth_stencil->draws;
batch->draws |= zs_draws;
batch->resolve |= zs_draws;
/* Mark everything dirty when debugging */
if (unlikely(dev->debug & PAN_DBG_DIRTY))
panfrost_dirty_state_all(ctx);
......@@ -3772,13 +3755,6 @@ panfrost_create_depth_stencil_state(struct pipe_context *pipe,
so->enabled = zsa->stencil[0].enabled ||
(zsa->depth_enabled && zsa->depth_func != PIPE_FUNC_ALWAYS);
/* Write masks need tracking together */
if (zsa->depth_writemask)
so->draws |= PIPE_CLEAR_DEPTH;
if (zsa->stencil[0].enabled)
so->draws |= PIPE_CLEAR_STENCIL;
/* TODO: Bounds test should be easy */
assert(!zsa->depth_bounds_test);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment