GitLab will be down for maintenance this Sunday 13th June, from approx 7-11am UTC. This is for a PostgreSQL migration. See the tracker issue for more informations.

Commit f2b6c49b authored by Alyssa Rosenzweig's avatar Alyssa Rosenzweig 💜
Browse files

panfrost: Import render condition check from fd


Signed-off-by: Alyssa Rosenzweig's avatarAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <mesa/mesa!8292>
parent 7ba4c545
......@@ -344,6 +344,9 @@ panfrost_flush(
struct pipe_fence_handle **fence,
unsigned flags);
bool
pan_render_condition_check(struct pipe_context *pctx);
mali_ptr panfrost_sfbd_fragment(struct panfrost_batch *batch, bool has_draws);
mali_ptr panfrost_mfbd_fragment(struct panfrost_batch *batch, bool has_draws);
......
......@@ -52,6 +52,25 @@
#include "decode.h"
#include "panfrost-quirks.h"
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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment