summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv30
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/nv30
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/nv30')
-rw-r--r--src/gallium/drivers/nv30/nv30_context.h1
-rw-r--r--src/gallium/drivers/nv30/nv30_miptree.c2
-rw-r--r--src/gallium/drivers/nv30/nv30_query.c4
3 files changed, 5 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h
index c90dd3c1061..3009a0c901a 100644
--- a/src/gallium/drivers/nv30/nv30_context.h
+++ b/src/gallium/drivers/nv30/nv30_context.h
@@ -129,6 +129,7 @@ struct nv30_context {
struct pipe_query *render_cond_query;
unsigned render_cond_mode;
+ boolean render_cond_cond;
};
static INLINE struct nv30_context *
diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c
index 4f5c445879a..c038d708a5f 100644
--- a/src/gallium/drivers/nv30/nv30_miptree.c
+++ b/src/gallium/drivers/nv30/nv30_miptree.c
@@ -213,7 +213,7 @@ nv30_blit(struct pipe_context *pipe,
util_blitter_save_fragment_sampler_views(nv30->blitter,
nv30->fragprog.num_textures, nv30->fragprog.textures);
util_blitter_save_render_condition(nv30->blitter, nv30->render_cond_query,
- nv30->render_cond_mode);
+ nv30->render_cond_cond, nv30->render_cond_mode);
util_blitter_blit(nv30->blitter, &info);
}
diff --git a/src/gallium/drivers/nv30/nv30_query.c b/src/gallium/drivers/nv30/nv30_query.c
index 877408648e0..a0a4c67a3d4 100644
--- a/src/gallium/drivers/nv30/nv30_query.c
+++ b/src/gallium/drivers/nv30/nv30_query.c
@@ -232,7 +232,8 @@ nv30_query_result(struct pipe_context *pipe, struct pipe_query *pq,
static void
nv40_query_render_condition(struct pipe_context *pipe,
- struct pipe_query *pq, uint mode)
+ struct pipe_query *pq,
+ boolean condition, uint mode)
{
struct nv30_context *nv30 = nv30_context(pipe);
struct nv30_query *q = nv30_query(pq);
@@ -240,6 +241,7 @@ nv40_query_render_condition(struct pipe_context *pipe,
nv30->render_cond_query = pq;
nv30->render_cond_mode = mode;
+ nv30->render_cond_cond = condition;
if (!pq) {
BEGIN_NV04(push, SUBC_3D(0x1e98), 1);