diff options
author | Roland Scheidegger <[email protected]> | 2013-06-14 19:48:57 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2013-06-18 18:01:24 +0200 |
commit | 793e8e3d7ed816cc9a066245dde798afdcf8b581 (patch) | |
tree | b71d5597d0d8669df8ed896b989bc519c82659d2 /src/gallium/drivers/nv50 | |
parent | 443dc15cf77edcaa7804c4277f0cce5d7c1d6b25 (diff) |
gallium: add condition parameter to render_condition
For conditional rendering this makes it possible to skip rendering
if either the predicate is true or false, as supported by d3d10
(in fact previously it was sort of implied skip rendering if predicate
is false for occlusion predicate, and true for so_overflow predicate).
There's no cap bit for this as presumably all drivers could do it trivially
(but this patch does not implement it for the drivers using true
hw predicates, nvxx, r600, radeonsi, no change is expected for OpenGL
functionality).
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers/nv50')
-rw-r--r-- | src/gallium/drivers/nv50/nv50_context.h | 1 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_query.c | 4 | ||||
-rw-r--r-- | src/gallium/drivers/nv50/nv50_surface.c | 2 |
3 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 043ed898913..0a83131fefd 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -156,6 +156,7 @@ struct nv50_context { boolean vbo_push_hint; struct pipe_query *cond_query; + boolean cond_cond; uint cond_mode; struct nv50_blitctx *blit; diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index f434f5f7939..656ff9daa43 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -321,13 +321,15 @@ nv84_query_fifo_wait(struct nouveau_pushbuf *push, struct pipe_query *pq) static void nv50_render_condition(struct pipe_context *pipe, - struct pipe_query *pq, uint mode) + struct pipe_query *pq, + boolean condition, uint mode) { struct nv50_context *nv50 = nv50_context(pipe); struct nouveau_pushbuf *push = nv50->base.pushbuf; struct nv50_query *q; nv50->cond_query = pq; + nv50->cond_cond = condition; nv50->cond_mode = mode; PUSH_SPACE(push, 6); diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 2bfd8556c66..d6066f2ae96 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -902,7 +902,7 @@ nv50_blitctx_post_blit(struct nv50_blitctx *blit) if (nv50->cond_query) nv50->base.pipe.render_condition(&nv50->base.pipe, nv50->cond_query, - nv50->cond_mode); + nv50->cond_cond, nv50->cond_mode); nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB); nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_TEXTURES); |