From 38e661c7d82fa0b34fbe9b3f3261295787bb6427 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 11 Jan 2012 08:18:52 +0100 Subject: mesa pixman xserver git update 11 jan 2012 --- mesalib/src/mesa/state_tracker/st_atom_clip.c | 24 +++++++----------------- 1 file changed, 7 insertions(+), 17 deletions(-) (limited to 'mesalib/src/mesa/state_tracker/st_atom_clip.c') diff --git a/mesalib/src/mesa/state_tracker/st_atom_clip.c b/mesalib/src/mesa/state_tracker/st_atom_clip.c index 236d3cf40..2a5110098 100644 --- a/mesalib/src/mesa/state_tracker/st_atom_clip.c +++ b/mesalib/src/mesa/state_tracker/st_atom_clip.c @@ -35,6 +35,7 @@ #include "pipe/p_context.h" #include "st_atom.h" #include "st_program.h" +#include "util/u_debug.h" #include "cso_cache/cso_context.h" @@ -44,10 +45,9 @@ static void update_clip( struct st_context *st ) { struct pipe_clip_state clip; const struct gl_context *ctx = st->ctx; - GLuint i; bool use_eye = FALSE; - memset(&clip, 0, sizeof(clip)); + assert(sizeof(clip.ucp) <= sizeof(ctx->Transform._ClipUserPlane)); /* if we have a vertex shader that writes clip vertex we need to pass the pre-projection transformed coordinates into the driver. */ @@ -56,21 +56,11 @@ static void update_clip( struct st_context *st ) use_eye = TRUE; } - for (i = 0; i < PIPE_MAX_CLIP_PLANES; i++) { - if (ctx->Transform.ClipPlanesEnabled & (1 << i)) { - memcpy(clip.ucp[clip.nr], - use_eye ? ctx->Transform.EyeUserPlane[i] : ctx->Transform._ClipUserPlane[i], - sizeof(clip.ucp[0])); - clip.nr++; - } - } - - clip.depth_clamp = ctx->Transform.DepthClamp != GL_FALSE; - - if (memcmp(&clip, &st->state.clip, sizeof(clip)) != 0) { - st->state.clip = clip; - cso_set_clip(st->cso_context, &clip); - } + memcpy(clip.ucp, + use_eye ? ctx->Transform.EyeUserPlane + : ctx->Transform._ClipUserPlane, sizeof(clip.ucp)); + st->state.clip = clip; + cso_set_clip(st->cso_context, &clip); } -- cgit v1.2.3