summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/clip.c
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2000-12-26 05:09:27 +0000
committerKeith Whitwell <[email protected]>2000-12-26 05:09:27 +0000
commitcab974cf6c2dbfbf5dd5d291e1aae0f8eeb34290 (patch)
tree45385bd755d8e3876c54b2b0113636f5ceb7976a /src/mesa/main/clip.c
parentd1ff1f6798b003a820f5de9fad835ff352f31afe (diff)
Major rework of tnl module
New array_cache module Support 8 texture units in core mesa (now support 8 everywhere) Rework core mesa statechange operations to avoid flushing on many noop statechanges.
Diffstat (limited to 'src/mesa/main/clip.c')
-rw-r--r--src/mesa/main/clip.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mesa/main/clip.c b/src/mesa/main/clip.c
index 131f3b60331..c2c7ec30093 100644
--- a/src/mesa/main/clip.c
+++ b/src/mesa/main/clip.c
@@ -1,4 +1,4 @@
-/* $Id: clip.c,v 1.18 2000/11/27 18:22:13 brianp Exp $ */
+/* $Id: clip.c,v 1.19 2000/12/26 05:09:27 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -56,7 +56,7 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
GET_CURRENT_CONTEXT(ctx);
GLint p;
GLfloat equation[4];
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane");
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
p = (GLint) plane - (GLint) GL_CLIP_PLANE0;
if (p < 0 || p >= ctx->Const.MaxClipPlanes) {
@@ -80,9 +80,13 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
if (ctx->ModelView.flags & MAT_DIRTY)
_math_matrix_analyse( &ctx->ModelView );
- gl_transform_vector( ctx->Transform.EyeUserPlane[p], equation,
- ctx->ModelView.inv );
+ gl_transform_vector( equation, equation, ctx->ModelView.inv );
+ if (TEST_EQ_4V(ctx->Transform.EyeUserPlane[p], equation))
+ return;
+
+ 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
@@ -97,8 +101,6 @@ _mesa_ClipPlane( GLenum plane, const GLdouble *eq )
ctx->ProjectionMatrix.inv );
}
- ctx->NewState |= _NEW_TRANSFORM;
-
if (ctx->Driver.ClipPlane)
ctx->Driver.ClipPlane( ctx, plane, equation );
}
@@ -109,9 +111,7 @@ _mesa_GetClipPlane( GLenum plane, GLdouble *equation )
{
GET_CURRENT_CONTEXT(ctx);
GLint p;
-
- ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetClipPlane");
-
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
p = (GLint) (plane - GL_CLIP_PLANE0);
if (p < 0 || p >= ctx->Const.MaxClipPlanes) {