summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/i915
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-12-18 14:14:44 -0800
committerEric Anholt <eric@anholt.net>2007-12-18 14:14:44 -0800
commita856da63247a4b403f6350914f732e14d1530ed1 (patch)
treedfaf1981a5d08ab66eb53b16215fff7052d600e8 /src/mesa/drivers/dri/i915
parent0dc2c68ffc379aa04247eb48b84b2fac69949bbd (diff)
[915] Make polygon stipple use pre-unpacked pixel data.
This fixes a crash when stippling using data from a PBO.
Diffstat (limited to 'src/mesa/drivers/dri/i915')
-rw-r--r--src/mesa/drivers/dri/i915/i915_state.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c
index e5d8d27993..21d2fe6289 100644
--- a/src/mesa/drivers/dri/i915/i915_state.c
+++ b/src/mesa/drivers/dri/i915/i915_state.c
@@ -311,7 +311,7 @@ static void
i915PolygonStipple(GLcontext * ctx, const GLubyte * mask)
{
struct i915_context *i915 = I915_CONTEXT(ctx);
- const GLubyte *m = mask;
+ const GLubyte *m;
GLubyte p[4];
int i, j, k;
int active = (ctx->Polygon.StippleFlag &&
@@ -323,6 +323,12 @@ i915PolygonStipple(GLcontext * ctx, const GLubyte * mask)
i915->state.Stipple[I915_STPREG_ST1] &= ~ST1_ENABLE;
}
+ /* Use the already unpacked stipple data from the context rather than the
+ * uninterpreted mask passed in.
+ */
+ mask = (const GLubyte *)ctx->PolygonStipple;
+ m = mask;
+
p[0] = mask[12] & 0xf;
p[0] |= p[0] << 4;
p[1] = mask[8] & 0xf;