From 793e8e3d7ed816cc9a066245dde798afdcf8b581 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 14 Jun 2013 19:48:57 +0200 Subject: 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 --- src/gallium/drivers/ilo/ilo_3d.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/drivers/ilo/ilo_3d.c') diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c index b2cbcf04e0c..17dd5b125e9 100644 --- a/src/gallium/drivers/ilo/ilo_3d.c +++ b/src/gallium/drivers/ilo/ilo_3d.c @@ -445,7 +445,7 @@ pass_render_condition(struct ilo_3d *hw3d, struct pipe_context *pipe) if (pipe->get_query_result(pipe, hw3d->render_condition.query, wait, (union pipe_query_result *) &result)) { - return (result > 0); + return (!result == hw3d->render_condition.cond); } else { return true; @@ -679,6 +679,7 @@ ilo_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info) static void ilo_render_condition(struct pipe_context *pipe, struct pipe_query *query, + boolean condition, uint mode) { struct ilo_context *ilo = ilo_context(pipe); @@ -687,6 +688,7 @@ ilo_render_condition(struct pipe_context *pipe, /* reference count? */ hw3d->render_condition.query = query; hw3d->render_condition.mode = mode; + hw3d->render_condition.cond = condition; } static void -- cgit v1.2.3