aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_atom_clip.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-01-09 16:34:28 +0100
committermarha <marha@users.sourceforge.net>2012-01-09 16:34:28 +0100
commita1e97828c89278770cb249039ec92d959440c640 (patch)
treef3d4ed7e3f3d589c606f01b3c9e6de03d638e2d3 /mesalib/src/mesa/state_tracker/st_atom_clip.c
parent7e9f4ea970e8f7008c212d7d3918a974eb0066da (diff)
downloadvcxsrv-a1e97828c89278770cb249039ec92d959440c640.tar.gz
vcxsrv-a1e97828c89278770cb249039ec92d959440c640.tar.bz2
vcxsrv-a1e97828c89278770cb249039ec92d959440c640.zip
xwininfo libX11 mesa mkfontscale xkeyboard-config git update 9 jan 2011
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_atom_clip.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_clip.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_atom_clip.c b/mesalib/src/mesa/state_tracker/st_atom_clip.c
index 1330db843..236d3cf40 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_clip.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_clip.c
@@ -34,7 +34,7 @@
#include "st_context.h"
#include "pipe/p_context.h"
#include "st_atom.h"
-
+#include "st_program.h"
#include "cso_cache/cso_context.h"
@@ -45,15 +45,23 @@ 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));
+ /* if we have a vertex shader that writes clip vertex we need to pass
+ the pre-projection transformed coordinates into the driver. */
+ if (st->vp) {
+ if (ctx->Shader.CurrentVertexProgram)
+ use_eye = TRUE;
+ }
+
for (i = 0; i < PIPE_MAX_CLIP_PLANES; i++) {
if (ctx->Transform.ClipPlanesEnabled & (1 << i)) {
- memcpy(clip.ucp[clip.nr],
- ctx->Transform._ClipUserPlane[i],
- sizeof(clip.ucp[0]));
- clip.nr++;
+ memcpy(clip.ucp[clip.nr],
+ use_eye ? ctx->Transform.EyeUserPlane[i] : ctx->Transform._ClipUserPlane[i],
+ sizeof(clip.ucp[0]));
+ clip.nr++;
}
}
@@ -69,7 +77,7 @@ static void update_clip( struct st_context *st )
const struct st_tracked_state st_update_clip = {
"st_update_clip", /* name */
{ /* dirty */
- (_NEW_TRANSFORM), /* mesa */
+ (_NEW_TRANSFORM | _NEW_PROGRAM), /* mesa */
0, /* st */
},
update_clip /* update */