if (batch->scoreboard.job_index > 10000)
batch = panfrost_get_fresh_batch_for_fbo(ctx);
- panfrost_batch_set_requirements(batch);
+ unsigned zs_draws = ctx->depth_stencil->draws;
+ batch->draws |= zs_draws;
+ batch->resolve |= zs_draws;
/* Take into account a negative bias */
ctx->indirect_draw = false;
if (batch->scoreboard.job_index + (indirect->draw_count * 3) > 10000)
batch = panfrost_get_fresh_batch_for_fbo(ctx);
- panfrost_batch_set_requirements(batch);
+ unsigned zs_draws = ctx->depth_stencil->draws;
+ batch->draws |= zs_draws;
+ batch->resolve |= zs_draws;
mali_ptr shared_mem = panfrost_batch_reserve_tls(batch, false);
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);
/* 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;
}
void
-panfrost_batch_set_requirements(struct panfrost_batch *batch)
-{
- struct panfrost_context *ctx = batch->ctx;
- unsigned draws = 0;
-
- if (ctx->depth_stencil && ctx->depth_stencil->base.depth_writemask)
- draws |= PIPE_CLEAR_DEPTH;
-
- if (ctx->depth_stencil && ctx->depth_stencil->base.stencil[0].enabled)
- draws |= PIPE_CLEAR_STENCIL;
-
- batch->draws |= draws;
- batch->resolve |= draws;
-}
-
-void
panfrost_batch_adjust_stack_size(struct panfrost_batch *batch)
{
struct panfrost_context *ctx = batch->ctx;