diff options
author | Eric Anholt <eric@anholt.net> | 2014-04-25 16:39:18 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2014-04-30 14:33:21 -0700 |
commit | 60c5f9716c90090f41e0796e93cc60a297fa883b (patch) | |
tree | 28e36c42c0eea0089e09a00e8a186e287470bea3 /src/mesa/drivers/dri/i965/gen8_multisample_state.c | |
parent | 973345fc2389e7f74b8732052e781672c4e135c2 (diff) | |
download | external_mesa3d-60c5f9716c90090f41e0796e93cc60a297fa883b.zip external_mesa3d-60c5f9716c90090f41e0796e93cc60a297fa883b.tar.gz external_mesa3d-60c5f9716c90090f41e0796e93cc60a297fa883b.tar.bz2 |
i965: Track the number of samples in the drawbuffer.
This keeps us from having to emit the nonpipelined state packet on every
FBO binding.
-4.42003% +/- 1.09961% effect on cairo-perf-trace runtime on glamor (n=110).
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/mesa/drivers/dri/i965/gen8_multisample_state.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/gen8_multisample_state.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/i965/gen8_multisample_state.c b/src/mesa/drivers/dri/i965/gen8_multisample_state.c index bfe0d5b..daf3e69 100644 --- a/src/mesa/drivers/dri/i965/gen8_multisample_state.c +++ b/src/mesa/drivers/dri/i965/gen8_multisample_state.c @@ -76,19 +76,15 @@ gen8_emit_3dstate_sample_pattern(struct brw_context *brw) static void upload_multisample_state(struct brw_context *brw) { - struct gl_context *ctx = &brw->ctx; - - /* _NEW_BUFFERS, _NEW_MULTISAMPLE */ - unsigned num_samples = ctx->DrawBuffer->Visual.samples; - - gen8_emit_3dstate_multisample(brw, num_samples); + gen8_emit_3dstate_multisample(brw, brw->num_samples); gen6_emit_3dstate_sample_mask(brw, gen6_determine_sample_mask(brw)); } const struct brw_tracked_state gen8_multisample_state = { .dirty = { - .mesa = _NEW_BUFFERS | _NEW_MULTISAMPLE, - .brw = BRW_NEW_CONTEXT, + .mesa = _NEW_MULTISAMPLE, + .brw = (BRW_NEW_CONTEXT | + BRW_NEW_NUM_SAMPLES), .cache = 0 }, .emit = upload_multisample_state |