diff options
author | Dave Airlie <[email protected]> | 2011-11-07 17:31:49 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2011-11-10 20:32:13 +0000 |
commit | ab14915dce41b26faabba878446b0ec0c8734434 (patch) | |
tree | 4d592760e7d4c621fc4098e5a1e6dd70eebb5feb /src/gallium/drivers/llvmpipe/lp_query.c | |
parent | dbd24b5df6739b85638020c0e5ab1cc9ff84a4b7 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_query.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_query.c | 18 |
1 files changed, 18 insertions, 0 deletions
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 ) { |