summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0
diff options
context:
space:
mode:
authorRoland Scheidegger <[email protected]>2013-06-14 19:48:57 +0200
committerRoland Scheidegger <[email protected]>2013-06-18 18:01:24 +0200
commit793e8e3d7ed816cc9a066245dde798afdcf8b581 (patch)
treeb71d5597d0d8669df8ed896b989bc519c82659d2 /src/gallium/drivers/nvc0
parent443dc15cf77edcaa7804c4277f0cce5d7c1d6b25 (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/nvc0')
-rw-r--r--src/gallium/drivers/nvc0/nvc0_context.h1
-rw-r--r--src/gallium/drivers/nvc0/nvc0_query.c4
-rw-r--r--src/gallium/drivers/nvc0/nvc0_surface.c2
3 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nvc0/nvc0_context.h b/src/gallium/drivers/nvc0/nvc0_context.h
index 799d9b9460a..0431b89e151 100644
--- a/src/gallium/drivers/nvc0/nvc0_context.h
+++ b/src/gallium/drivers/nvc0/nvc0_context.h
@@ -189,6 +189,7 @@ struct nvc0_context {
unsigned num_tfbbufs;
struct pipe_query *cond_query;
+ boolean cond_cond;
uint cond_mode;
struct nvc0_blitctx *blit;
diff --git a/src/gallium/drivers/nvc0/nvc0_query.c b/src/gallium/drivers/nvc0/nvc0_query.c
index d905f1a8115..8e584c900a6 100644
--- a/src/gallium/drivers/nvc0/nvc0_query.c
+++ b/src/gallium/drivers/nvc0/nvc0_query.c
@@ -518,7 +518,8 @@ nvc0_query_fifo_wait(struct nouveau_pushbuf *push, struct pipe_query *pq)
static void
nvc0_render_condition(struct pipe_context *pipe,
- struct pipe_query *pq, uint mode)
+ struct pipe_query *pq,
+ boolean condition, uint mode)
{
struct nvc0_context *nvc0 = nvc0_context(pipe);
struct nouveau_pushbuf *push = nvc0->base.pushbuf;
@@ -530,6 +531,7 @@ nvc0_render_condition(struct pipe_context *pipe,
mode != PIPE_RENDER_COND_BY_REGION_NO_WAIT;
nvc0->cond_query = pq;
+ nvc0->cond_cond = condition;
nvc0->cond_mode = mode;
if (!pq) {
diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c
index e02cf22f506..c8d26f5a124 100644
--- a/src/gallium/drivers/nvc0/nvc0_surface.c
+++ b/src/gallium/drivers/nvc0/nvc0_surface.c
@@ -801,7 +801,7 @@ nvc0_blitctx_post_blit(struct nvc0_blitctx *blit)
if (nvc0->cond_query)
nvc0->base.pipe.render_condition(&nvc0->base.pipe, nvc0->cond_query,
- nvc0->cond_mode);
+ nvc0->cond_cond, nvc0->cond_mode);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_FB);
nouveau_bufctx_reset(nvc0->bufctx_3d, NVC0_BIND_TEX(4, 0));