aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/clip.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-03-20 16:32:44 +0000
committermarha <marha@users.sourceforge.net>2011-03-20 16:32:44 +0000
commiteca5dee9e7a8dea1edba4d10b60444ac0e884139 (patch)
tree67c0e6552d06cb59b33ef79ece38d6581b2c8976 /mesalib/src/mesa/main/clip.c
parentd7f1bd4112420f1d4b41c5409074eca6b34bf507 (diff)
downloadvcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.tar.gz
vcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.tar.bz2
vcxsrv-eca5dee9e7a8dea1edba4d10b60444ac0e884139.zip
xserver libX11 libxcb pixman mesa git update 20 Mar 2011
Diffstat (limited to 'mesalib/src/mesa/main/clip.c')
-rw-r--r--mesalib/src/mesa/main/clip.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/mesalib/src/mesa/main/clip.c b/mesalib/src/mesa/main/clip.c
index bec04de72..6b9b3b58c 100644
--- a/mesalib/src/mesa/main/clip.c
+++ b/mesalib/src/mesa/main/clip.c
@@ -32,11 +32,20 @@
#include "math/m_matrix.h"
+/**
+ * Update derived clip plane state.
+ */
+void
+_mesa_update_clip_plane(struct gl_context *ctx, GLuint plane)
+{
+ if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
+ _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
-/**********************************************************************/
-/* Get/Set User clip-planes. */
-/**********************************************************************/
-
+ /* Clip-Space Plane = Eye-Space Plane * Projection Matrix */
+ _mesa_transform_vector(ctx->Transform._ClipUserPlane[plane],
+ ctx->Transform.EyeUserPlane[plane],
+ ctx->ProjectionMatrixStack.Top->inv);
+}
void GLAPIENTRY
@@ -78,17 +87,8 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
FLUSH_VERTICES(ctx, _NEW_TRANSFORM);
COPY_4FV(ctx->Transform.EyeUserPlane[p], equation);
- /* Update derived state. This state also depends on the projection
- * matrix, and is recalculated on changes to the projection matrix by
- * code in _mesa_update_state().
- */
if (ctx->Transform.ClipPlanesEnabled & (1 << p)) {
- if (_math_matrix_is_dirty(ctx->ProjectionMatrixStack.Top))
- _math_matrix_analyse( ctx->ProjectionMatrixStack.Top );
-
- _mesa_transform_vector( ctx->Transform._ClipUserPlane[p],
- ctx->Transform.EyeUserPlane[p],
- ctx->ProjectionMatrixStack.Top->inv );
+ _mesa_update_clip_plane(ctx, p);
}
if (ctx->Driver.ClipPlane)