summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2010-11-19 22:53:31 +0800
committerEric Anholt <eric@anholt.net>2010-11-23 09:23:30 -0800
commite29e3c32d9d52fc206ab3ccc8674683adc880e82 (patch)
tree9a789e8b373c856460e6ceea2e5d50ac0174de39
parent7720bfffa3fd537789b5ded30ecc23afa21dc410 (diff)
i965: Don't upload polygon stipple unless required.
-rw-r--r--src/mesa/drivers/dri/i965/brw_misc_state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c
index 52266edf8e..8dae58784c 100644
--- a/src/mesa/drivers/dri/i965/brw_misc_state.c
+++ b/src/mesa/drivers/dri/i965/brw_misc_state.c
@@ -305,6 +305,9 @@ static void upload_polygon_stipple(struct brw_context *brw)
struct brw_polygon_stipple bps;
GLuint i;
+ if (!ctx->Polygon.StippleFlag)
+ return;
+
memset(&bps, 0, sizeof(bps));
bps.header.opcode = CMD_POLY_STIPPLE_PATTERN;
bps.header.length = sizeof(bps)/4-2;
@@ -347,6 +350,9 @@ static void upload_polygon_stipple_offset(struct brw_context *brw)
struct gl_context *ctx = &brw->intel.ctx;
struct brw_polygon_stipple_offset bpso;
+ if (!ctx->Polygon.StippleFlag)
+ return;
+
memset(&bpso, 0, sizeof(bpso));
bpso.header.opcode = CMD_POLY_STIPPLE_OFFSET;
bpso.header.length = sizeof(bpso)/4-2;
@@ -375,7 +381,7 @@ static void upload_polygon_stipple_offset(struct brw_context *brw)
const struct brw_tracked_state brw_polygon_stipple_offset = {
.dirty = {
- .mesa = _NEW_WINDOW_POS,
+ .mesa = _NEW_WINDOW_POS | _NEW_POLYGONSTIPPLE,
.brw = BRW_NEW_CONTEXT,
.cache = 0
},