summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-07-28 12:44:41 -0700
committerMatt Turner <[email protected]>2016-08-01 12:09:17 -0700
commit12a14052e81d5384d1e040305b388db375e21490 (patch)
tree0e8a5a52ef45e673f4e29b10d0c9980280c5b0df /src
parentbe35c6ba92ec460f3fc2b172c556d9dc3e253fce (diff)
i915: Avoid aliasing violation.
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/i915/intel_clear.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_clear.c b/src/mesa/drivers/dri/i915/intel_clear.c
index 8cf7c142f31..4306826b876 100644
--- a/src/mesa/drivers/dri/i915/intel_clear.c
+++ b/src/mesa/drivers/dri/i915/intel_clear.c
@@ -81,7 +81,7 @@ static void
intelClear(struct gl_context *ctx, GLbitfield mask)
{
struct intel_context *intel = intel_context(ctx);
- const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask[0]);
+ GLuint colorMask;
GLbitfield tri_mask = 0;
GLbitfield blit_mask = 0;
GLbitfield swrast_mask = 0;
@@ -89,6 +89,8 @@ intelClear(struct gl_context *ctx, GLbitfield mask)
struct intel_renderbuffer *irb;
int i;
+ memcpy(&colorMask, &ctx->Color.ColorMask[0], sizeof(colorMask));
+
if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) {
intel->front_buffer_dirty = true;
}