From a856da63247a4b403f6350914f732e14d1530ed1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 18 Dec 2007 14:14:44 -0800 Subject: [PATCH] [915] Make polygon stipple use pre-unpacked pixel data. This fixes a crash when stippling using data from a PBO. --- src/mesa/drivers/dri/i915/i915_state.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index e5d8d279936..21d2fe6289f 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; -- 2.30.2