diff options
author | Kenneth Graunke <[email protected]> | 2013-05-15 21:33:01 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-05-20 13:03:18 -0700 |
commit | e32cd5ffbb7231f8d4bb44189492c89c9a4fbfa9 (patch) | |
tree | 4a8fd7a861228148eb20a7b62297ed33cbb929ff /src/mesa/drivers/dri/i965/brw_context.c | |
parent | 72b1e440dde1b8430cc63774efa22b6d360fc51e (diff) |
i965: Rely on hardware contexts for query objects on Gen6+.
Hardware contexts greatly simplify the query object code. The pipeline
statistics counters get saved and restored with the context, which means
that we don't need to worry about other workloads polluting them.
This means that we can simply write a single pair of values (one at
BeginQuery and one at EndQuery) rather than a series of pairs. This
also means we don't need to worry about the BO getting full. We also
don't need to delay BO allocation and starting snapshot until the first
draw.
The generation split here is a little off: technically, Ironlake can also
support hardware contexts. However, the kernel currently doesn't, and
even if it were to do so someday, we'd need to wait a while before
bumping the kernel requirement to take advantage of it.
v2: Incorporate Paul's feedback.
- Clarify which functions are Gen4/5-only via assertions and comments.
- Change how driver hook initialization happens.
- Update comments.
- Squash a bug fix from a later commit here where it belongs.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]> [v1]
Acked-by: Paul Berry <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_context.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_context.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 2f5fedbbb49..405580f5310 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -87,7 +87,11 @@ static void brwInitDriverFunctions(struct intel_screen *screen, intelInitDriverFunctions( functions ); brwInitFragProgFuncs( functions ); - brw_init_queryobj_functions(functions); + brw_init_common_queryobj_functions(functions); + if (screen->gen >= 6) + gen6_init_queryobj_functions(functions); + else + gen4_init_queryobj_functions(functions); functions->QuerySamplesForFormat = brw_query_samples_for_format; functions->BeginTransformFeedback = brw_begin_transform_feedback; |