mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
panfrost: Import render condition check from fd
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
7ba4c5450c
commit
f2b6c49b33
2 changed files with 22 additions and 0 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue