mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 00:00:11 +01:00
panfrost: Respect the render condition
Clears, draws, and blits should check. All from freedreno. Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8292>
This commit is contained in:
parent
f2b6c49b33
commit
9f1bbf9efb
2 changed files with 19 additions and 2 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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) */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue