diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2016-04-27 09:35:03 -0700 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2016-05-16 00:11:51 -0700 |
commit | b6f250d7f2f704c8681aaa2a158d1a39851b8494 (patch) | |
tree | efe2c6e0933c9100260566bea5903aed4516102b /src/mesa/drivers/dri/i965/brw_state_upload.c | |
parent | 97179c606c998b4f6810b4dc1c5007c848cda4ee (diff) |
i965: Send the minimal number of STATE_BASE_ADDRESS packets.
STATE_BASE_ADDRESS stalls the whole pipeline, and the documentation
cautions us to emit it as little as possible for better performance.
We recently put some hacks in BLORP to try and avoid emitting it
if it was already set correctly. However, this wasn't quite minimal:
if BLORP is the first operation (i.e. glClear()), then it would emit
it, and subsequent draw calls would emit it again.
This caused a small drop in performance in GPUTest Triangle when
switching from Meta to BLORP.
Unlike most packets, STATE_BASE_ADDRESS isn't influenced by GL state:
it needs to be emitted once per batch, before most other commands, or
whenever we change the program cache BO. It's also valid in both the
3D and compute pipelines, which makes it even more unique.
This patch removes it from the atom mechanism and instead directly
calls it as part of every draw, compute dispatch, or BLORP operation.
We introduce a new flag indicating that STATE_BASE_ADDRESS has already
been emitted this batch, and if so, skip doing it again. When we make
a new program cache BO, we simply reset the flag, so the next operation
will emit it again. When we flush/reset the batch, we reset the flag.
This guarantees that we'll emit STATE_BASE_ADDRESS only when we have to.
It's also less code than the old atom mechanism.
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_state_upload.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_state_upload.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index ed92a85f92..0b47ebe3a1 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -79,7 +79,6 @@ static const struct brw_tracked_state *gen4_atoms[] = /* Command packets: */ &brw_invariant_state, - &brw_state_base_address, &brw_binding_table_pointers, &brw_blend_constant_color, @@ -109,9 +108,6 @@ static const struct brw_tracked_state *gen6_atoms[] = /* Command packets: */ - /* must do before binding table pointers, cc state ptrs */ - &brw_state_base_address, - &brw_cc_vp, &gen6_viewport_state, /* must do after *_vp stages */ @@ -175,9 +171,6 @@ static const struct brw_tracked_state *gen7_render_atoms[] = { /* Command packets: */ - /* must do before binding table pointers, cc state ptrs */ - &brw_state_base_address, - &brw_cc_vp, &gen7_sf_clip_viewport, @@ -268,7 +261,6 @@ static const struct brw_tracked_state *gen7_render_atoms[] = static const struct brw_tracked_state *gen7_compute_atoms[] = { - &brw_state_base_address, &gen7_l3_state, &brw_cs_image_surfaces, &gen7_cs_push_constants, @@ -283,9 +275,6 @@ static const struct brw_tracked_state *gen7_compute_atoms[] = static const struct brw_tracked_state *gen8_render_atoms[] = { - /* Command packets: */ - &brw_state_base_address, - &brw_cc_vp, &gen8_sf_clip_viewport, @@ -383,7 +372,6 @@ static const struct brw_tracked_state *gen8_render_atoms[] = static const struct brw_tracked_state *gen8_compute_atoms[] = { - &brw_state_base_address, &gen7_l3_state, &brw_cs_image_surfaces, &gen7_cs_push_constants, @@ -847,6 +835,8 @@ brw_upload_pipeline_state(struct brw_context *brw, brw_upload_programs(brw, pipeline); merge_ctx_state(brw, &state); + brw_upload_state_base_address(brw); + const struct brw_tracked_state *atoms = brw_get_pipeline_atoms(brw, pipeline); const int num_atoms = brw->num_atoms[pipeline]; |