summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_state_upload.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2014-04-25 16:39:18 -0700
committerEric Anholt <eric@anholt.net>2014-04-30 14:33:21 -0700
commit60c5f9716c90090f41e0796e93cc60a297fa883b (patch)
tree28e36c42c0eea0089e09a00e8a186e287470bea3 /src/mesa/drivers/dri/i965/brw_state_upload.c
parent973345fc2389e7f74b8732052e781672c4e135c2 (diff)
downloadexternal_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/brw_state_upload.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_state_upload.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c
index 7ae2e1e..3a452c3 100644
--- a/src/mesa/drivers/dri/i965/brw_state_upload.c
+++ b/src/mesa/drivers/dri/i965/brw_state_upload.c
@@ -507,6 +507,7 @@ static struct dirty_bit_map brw_bits[] = {
DEFINE_BIT(BRW_NEW_META_IN_PROGRESS),
DEFINE_BIT(BRW_NEW_INTERPOLATION_MAP),
DEFINE_BIT(BRW_NEW_PUSH_CONSTANT_ALLOCATION),
+ DEFINE_BIT(BRW_NEW_NUM_SAMPLES),
{0, 0, 0}
};
@@ -604,6 +605,11 @@ void brw_upload_state(struct brw_context *brw)
brw->state.dirty.brw |= BRW_NEW_META_IN_PROGRESS;
}
+ if (brw->num_samples != ctx->DrawBuffer->Visual.samples) {
+ brw->num_samples = ctx->DrawBuffer->Visual.samples;
+ brw->state.dirty.brw |= BRW_NEW_NUM_SAMPLES;
+ }
+
if ((state->mesa | state->cache | state->brw) == 0)
return;