i965: Improve conditional rendering in fallback paths

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 16 June 2017 01:42 EDT

We need to fall back in a couple of cases:- Sandybridge (it just doesn't do this in hardware)- Occlusion queries on Gen7-7.5 with command parser version < 2- Transform feedback overflow queries on Gen7, or on Gen7.5 with command parser version < 7

In these cases, we printed a perf_debug message and fell back to _mesa_check_conditional_render(), which stalls until the full query result is available. Additionally, the code to handle this was a bit of a mess.

We can do better by using our normal conditional rendering code, and setting a new state, BRW_PREDICATE_STATE_STALL_FOR_QUERY, when we would have set BRW_PREDICATE_STATE_USE_BIT. Only if that state is set do we perf_debug and potentially stall. This means we avoid stalls when we have a partial query result (i.e. we know it's > 0, but don't have the full value). The perf_debug should trigger less often as well.

Still, this is primarily intended as a cleanup.

ad412d6 i965: Improve conditional rendering in fallback paths.
src/mesa/drivers/dri/i965/brw_conditional_render.c | 86 +++++++++++-----------
src/mesa/drivers/dri/i965/brw_context.c | 3 +-
src/mesa/drivers/dri/i965/brw_context.h | 6 +-
3 files changed, 48 insertions(+), 47 deletions(-)

Upstream: cgit.freedesktop.org

  • Share