* u_blitter. We could do a little better by culling
* vertex jobs, though. */
- if (info->render_condition_enable && !pan_render_condition_check(pipe))
+ if (info->render_condition_enable &&
+ !panfrost_render_condition_check(pan_context(pipe)))
return;
if (panfrost_u_blitter_blit(pipe, info))
{
struct panfrost_context *ctx = pan_context(pipe);
- if (!pan_render_condition_check(pipe))
+ if (!panfrost_render_condition_check(ctx))
return;
/* TODO: panfrost_get_fresh_batch_for_fbo() instantiates a new batch if
struct panfrost_context *ctx = pan_context(pipe);
struct panfrost_device *device = pan_device(ctx->base.screen);
- if (!pan_render_condition_check(pipe))
+ if (!panfrost_render_condition_check(ctx))
return;
/* First of all, check the scissor to see if anything is drawn at all.
return true;
}
+bool
+panfrost_render_condition_check(struct panfrost_context *ctx)
+{
+ if (!ctx->cond_query)
+ return true;
+
+ union pipe_query_result res = { 0 };
+ bool wait =
+ ctx->cond_mode != PIPE_RENDER_COND_NO_WAIT &&
+ ctx->cond_mode != PIPE_RENDER_COND_BY_REGION_NO_WAIT;
+
+ struct pipe_query *pq = (struct pipe_query *)ctx->cond_query;
+
+ if (panfrost_get_query_result(&ctx->base, pq, wait, &res))
+ return res.u64 != ctx->cond_cond;
+
+ return true;
+}
+
static struct pipe_stream_output_target *
panfrost_create_stream_output_target(struct pipe_context *pctx,
struct pipe_resource *prsc,
unsigned flags);
bool
-pan_render_condition_check(struct pipe_context *pctx);
+panfrost_render_condition_check(struct panfrost_context *ctx);
mali_ptr panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws);
mali_ptr panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws);
static bool
panfrost_should_checksum(const struct panfrost_device *dev, const struct panfrost_resource *pres);
-bool
-pan_render_condition_check(struct pipe_context *pctx)
-{
- struct panfrost_context *ctx = pan_context(pctx);
-
- if (!ctx->cond_query)
- return true;
-
- union pipe_query_result res = { 0 };
- bool wait =
- ctx->cond_mode != PIPE_RENDER_COND_NO_WAIT &&
- ctx->cond_mode != PIPE_RENDER_COND_BY_REGION_NO_WAIT;
-
- if (pctx->get_query_result(pctx, (struct pipe_query *) ctx->cond_query, wait, &res))
- return (bool)res.u64 != ctx->cond_cond;
-
- return true;
-}
-
static struct pipe_resource *
panfrost_resource_from_handle(struct pipe_screen *pscreen,
const struct pipe_resource *templat,