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/docs/source/context.rst | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/gallium/docs') diff --git a/src/gallium/docs/source/context.rst b/src/gallium/docs/source/context.rst index 6a8238e..ede89be 100644 --- a/src/gallium/docs/source/context.rst +++ b/src/gallium/docs/source/context.rst @@ -382,15 +382,19 @@ Conditional Rendering ^^^^^^^^^^^^^^^^^^^^^ A drawing command can be skipped depending on the outcome of a query -(typically an occlusion query). The ``render_condition`` function specifies -the query which should be checked prior to rendering anything. +(typically an occlusion query, or streamout overflow predicate). +The ``render_condition`` function specifies the query which should be checked +prior to rendering anything. Functions honoring render_condition include +(and are limited to) draw_vbo, clear, clear_render_target, clear_depth_stencil. If ``render_condition`` is called with ``query`` = NULL, conditional rendering is disabled and drawing takes place normally. If ``render_condition`` is called with a non-null ``query`` subsequent -drawing commands will be predicated on the outcome of the query. If -the query result is zero subsequent drawing commands will be skipped. +drawing commands will be predicated on the outcome of the query. +Commands will be skipped if ``condition`` is equal to the predicate result +(for non-boolean queries such as OCCLUSION_QUERY, zero counts as FALSE, +non-zero as TRUE). If ``mode`` is PIPE_RENDER_COND_WAIT the driver will wait for the query to complete before deciding whether to render. @@ -401,7 +405,7 @@ has completed, drawing will be predicated on the outcome of the query. If ``mode`` is PIPE_RENDER_COND_BY_REGION_WAIT or PIPE_RENDER_COND_BY_REGION_NO_WAIT rendering will be predicated as above -for the non-REGION modes but in the case that an occulusion query returns +for the non-REGION modes but in the case that an occlusion query returns a non-zero result, regions which were occluded may be ommitted by subsequent drawing commands. This can result in better performance with some GPUs. Normally, if the occlusion query returned a non-zero result subsequent -- cgit v1.1