aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_clip.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-11 08:18:52 +0100
committermarha <marha@users.sourceforge.net>2012-01-11 08:18:52 +0100
commit38e661c7d82fa0b34fbe9b3f3261295787bb6427 (patch)
treeef71c86cfe741318555e06dec3e9e2817d731e7a /mesalib/src/mesa/state_tracker/st_atom_clip.c
parenta1e97828c89278770cb249039ec92d959440c640 (diff)
downloadvcxsrv-38e661c7d82fa0b34fbe9b3f3261295787bb6427.tar.gz
vcxsrv-38e661c7d82fa0b34fbe9b3f3261295787bb6427.tar.bz2
vcxsrv-38e661c7d82fa0b34fbe9b3f3261295787bb6427.zip
mesa pixman xserver git update 11 jan 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_clip.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_clip.c24
1 files changed, 7 insertions, 17 deletions
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);
}