Mesa (master): panfrost: Respect the render condition
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Jan 1 05:26:34 UTC 2021
Module: Mesa
Branch: master
Commit: 9f1bbf9efbc181577a9a88131ae31e7c73e68f57
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=9f1bbf9efbc181577a9a88131ae31e7c73e68f57
Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date: Thu Dec 31 23:49:10 2020 -0500
panfrost: Respect the render condition
Clears, draws, and blits should check. All from freedreno.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8292>
---
src/gallium/drivers/panfrost/pan_blit.c | 15 +++++++++++++--
src/gallium/drivers/panfrost/pan_context.c | 6 ++++++
2 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_blit.c b/src/gallium/drivers/panfrost/pan_blit.c
index 59c505bd297..610cee2e53d 100644
--- a/src/gallium/drivers/panfrost/pan_blit.c
+++ b/src/gallium/drivers/panfrost/pan_blit.c
@@ -34,7 +34,8 @@
static void
panfrost_blitter_save(
struct panfrost_context *ctx,
- struct blitter_context *blitter)
+ struct blitter_context *blitter,
+ bool render_cond)
{
util_blitter_save_vertex_buffer_slot(blitter, ctx->vertex_buffers);
@@ -59,6 +60,13 @@ panfrost_blitter_save(
(struct pipe_sampler_view **)&ctx->sampler_views[PIPE_SHADER_FRAGMENT]);
util_blitter_save_fragment_constant_buffer_slot(blitter,
ctx->constant_buffer[PIPE_SHADER_FRAGMENT].cb);
+
+ if (!render_cond) {
+ util_blitter_save_render_condition(blitter,
+ (struct pipe_query *) ctx->cond_query,
+ ctx->cond_cond, ctx->cond_mode);
+ }
+
}
static bool
@@ -72,7 +80,7 @@ panfrost_u_blitter_blit(struct pipe_context *pipe,
/* TODO: Scissor */
- panfrost_blitter_save(ctx, ctx->blitter);
+ panfrost_blitter_save(ctx, ctx->blitter, info->render_condition_enable);
util_blitter_blit(ctx->blitter, info);
return true;
@@ -86,6 +94,9 @@ panfrost_blit(struct pipe_context *pipe,
* u_blitter. We could do a little better by culling
* vertex jobs, though. */
+ if (info->render_condition_enable && !pan_render_condition_check(pipe))
+ return;
+
if (panfrost_u_blitter_blit(pipe, info))
return;
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 7dd324f634f..ed4a91e12ab 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -131,6 +131,9 @@ panfrost_clear(
{
struct panfrost_context *ctx = pan_context(pipe);
+ if (!pan_render_condition_check(pipe))
+ return;
+
/* TODO: panfrost_get_fresh_batch_for_fbo() instantiates a new batch if
* the existing batch targeting this FBO has draws. We could probably
* avoid that by replacing plain clears by quad-draws with a specific
@@ -457,6 +460,9 @@ panfrost_draw_vbo(
struct panfrost_context *ctx = pan_context(pipe);
struct panfrost_device *device = pan_device(ctx->base.screen);
+ if (!pan_render_condition_check(pipe))
+ return;
+
/* First of all, check the scissor to see if anything is drawn at all.
* If it's not, we drop the draw (mostly a conformance issue;
* well-behaved apps shouldn't hit this) */
More information about the mesa-commit
mailing list