aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2020-07-15 17:35:58 -0400
committerMarge Bot <[email protected]>2020-07-15 22:19:37 +0000
commit5d0d8faaa641c7720b33a3d8e02c798fdd93af7b (patch)
tree44f57f20b6d517d30163ae32ebb1daec8c5a6e12 /src/gallium
parent64734c0947ecfb8908e6bdfd4e73a4c724019476 (diff)
panfrost: Track surfaces drawn per-batch
Signed-off-by: Alyssa Rosenzweig <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/panfrost/pan_cmdstream.c4
-rw-r--r--src/gallium/drivers/panfrost/pan_job.c7
-rw-r--r--src/gallium/drivers/panfrost/pan_job.h3
3 files changed, 13 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_cmdstream.c b/src/gallium/drivers/panfrost/pan_cmdstream.c
index 8fecdde0066..6e31d9bc4b9 100644
--- a/src/gallium/drivers/panfrost/pan_cmdstream.c
+++ b/src/gallium/drivers/panfrost/pan_cmdstream.c
@@ -668,6 +668,7 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
struct mali_shader_meta *fragmeta,
void *rts)
{
+ struct panfrost_batch *batch = panfrost_get_batch_for_fbo(ctx);
const struct panfrost_device *dev = pan_device(ctx->base.screen);
struct panfrost_shader_state *fs;
fs = panfrost_get_shader_state(ctx, PIPE_SHADER_FRAGMENT);
@@ -749,6 +750,8 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
SET_BIT(fragmeta->unknown2_3, MALI_CAN_DISCARD,
!blend[0].no_blending || fs->can_discard);
+
+ batch->draws |= PIPE_CLEAR_COLOR0;
return;
}
@@ -769,6 +772,7 @@ panfrost_frag_meta_blend_update(struct panfrost_context *ctx,
if (ctx->pipe_framebuffer.nr_cbufs > i && !blend[i].no_colour) {
flags = 0x200;
+ batch->draws |= (PIPE_CLEAR_COLOR0 << i);
bool is_srgb = (ctx->pipe_framebuffer.nr_cbufs > i) &&
(ctx->pipe_framebuffer.cbufs[i]) &&
diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c
index f83cbeaf483..bc9dab58cf2 100644
--- a/src/gallium/drivers/panfrost/pan_job.c
+++ b/src/gallium/drivers/panfrost/pan_job.c
@@ -1182,8 +1182,13 @@ panfrost_batch_set_requirements(struct panfrost_batch *batch)
if (ctx->rasterizer && ctx->rasterizer->base.multisample)
batch->requirements |= PAN_REQ_MSAA;
- if (ctx->depth_stencil && ctx->depth_stencil->depth.writemask)
+ if (ctx->depth_stencil && ctx->depth_stencil->depth.writemask) {
batch->requirements |= PAN_REQ_DEPTH_WRITE;
+ batch->draws |= PIPE_CLEAR_DEPTH;
+ }
+
+ if (ctx->depth_stencil && ctx->depth_stencil->stencil[0].enabled)
+ batch->draws |= PIPE_CLEAR_STENCIL;
}
void
diff --git a/src/gallium/drivers/panfrost/pan_job.h b/src/gallium/drivers/panfrost/pan_job.h
index b5f639894e0..409644d2cfd 100644
--- a/src/gallium/drivers/panfrost/pan_job.h
+++ b/src/gallium/drivers/panfrost/pan_job.h
@@ -75,6 +75,9 @@ struct panfrost_batch {
/* Buffers cleared (PIPE_CLEAR_* bitmask) */
unsigned clear;
+ /* Buffers drawn */
+ unsigned draws;
+
/* Packed clear values, indexed by both render target as well as word.
* Essentially, a single pixel is packed, with some padding to bring it
* up to a 32-bit interval; that pixel is then duplicated over to fill