From ab14915dce41b26faabba878446b0ec0c8734434 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 7 Nov 2011 17:31:49 +0000 Subject: llvmpipe: add NV_conditional_render support. This ports the softpipe NV_conditional_render support to llvmpipe. This passes the nv_conditional_render-* piglit tests. Signed-off-by: Dave Airlie --- src/gallium/drivers/llvmpipe/lp_query.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gallium/drivers/llvmpipe/lp_query.c') diff --git a/src/gallium/drivers/llvmpipe/lp_query.c b/src/gallium/drivers/llvmpipe/lp_query.c index 1e2401fa84d..42eb8566ef4 100644 --- a/src/gallium/drivers/llvmpipe/lp_query.c +++ b/src/gallium/drivers/llvmpipe/lp_query.c @@ -154,6 +154,24 @@ llvmpipe_end_query(struct pipe_context *pipe, struct pipe_query *q) llvmpipe->dirty |= LP_NEW_QUERY; } +boolean +llvmpipe_check_render_cond(struct llvmpipe_context *lp) +{ + struct pipe_context *pipe = &lp->pipe; + boolean b, wait; + uint64_t result; + + if (!lp->render_cond_query) + return TRUE; /* no query predicate, draw normally */ + wait = (lp->render_cond_mode == PIPE_RENDER_COND_WAIT || + lp->render_cond_mode == PIPE_RENDER_COND_BY_REGION_WAIT); + + b = pipe->get_query_result(pipe, lp->render_cond_query, wait, &result); + if (b) + return result > 0; + else + return TRUE; +} void llvmpipe_init_query_funcs(struct llvmpipe_context *llvmpipe ) { -- cgit v1.2.3