summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/points.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/points.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/points.c')
-rw-r--r--src/mesa/main/points.c44
1 files changed, 30 insertions, 14 deletions
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index b70e5f05c47..3becddb34cc 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -1,4 +1,4 @@
-/* $Id: points.c,v 1.25 2000/12/08 00:20:15 brianp Exp $ */
+/* $Id: points.c,v 1.26 2000/12/26 05:09:29 keithw Exp $ */
/*
* Mesa 3-D graphics library
@@ -44,21 +44,22 @@ void
_mesa_PointSize( GLfloat size )
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize");
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
if (size <= 0.0) {
gl_error( ctx, GL_INVALID_VALUE, "glPointSize" );
return;
}
- if (ctx->Point.Size != size) {
- ctx->Point.Size = size;
- ctx->Point._Size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize);
- ctx->_TriangleCaps &= ~DD_POINT_SIZE;
- if (size != 1.0)
- ctx->_TriangleCaps |= DD_POINT_SIZE;
- ctx->NewState |= _NEW_POINT;
- }
+ if (ctx->Point.Size == size)
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POINT);
+ ctx->Point.Size = size;
+ ctx->Point._Size = CLAMP(size,
+ ctx->Const.MinPointSize,
+ ctx->Const.MaxPointSize);
+ ctx->_TriangleCaps ^= DD_POINT_SIZE;
}
@@ -74,13 +75,22 @@ void
_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
{
GET_CURRENT_CONTEXT(ctx);
- ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointParameterfvEXT");
+ ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (pname) {
case GL_DISTANCE_ATTENUATION_EXT:
{
const GLboolean tmp = ctx->Point._Attenuated;
+ if (TEST_EQ_3V(ctx->Point.Params, params))
+ return;
+
+ FLUSH_VERTICES(ctx, _NEW_POINT);
COPY_3V(ctx->Point.Params, params);
+
+ /* Update several derived values now. This likely to be
+ * more efficient than trying to catch this statechange in
+ * state.c.
+ */
ctx->Point._Attenuated = (params[0] != 1.0 ||
params[1] != 0.0 ||
params[2] != 0.0);
@@ -88,7 +98,6 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
if (tmp != ctx->Point._Attenuated) {
ctx->_Enabled ^= ENABLE_POINT_ATTEN;
ctx->_TriangleCaps ^= DD_POINT_ATTEN;
- /* XXX why is this here and not in state.c? */
ctx->_NeedEyeCoords ^= NEED_EYE_POINT_ATTEN;
}
}
@@ -98,6 +107,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
return;
}
+ if (ctx->Point.MinSize == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.MinSize = *params;
break;
case GL_POINT_SIZE_MAX_EXT:
@@ -105,6 +117,9 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
return;
}
+ if (ctx->Point.MaxSize == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.MaxSize = *params;
break;
case GL_POINT_FADE_THRESHOLD_SIZE_EXT:
@@ -112,13 +127,14 @@ _mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params)
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" );
return;
}
+ if (ctx->Point.Threshold == *params)
+ return;
+ FLUSH_VERTICES(ctx, _NEW_POINT);
ctx->Point.Threshold = *params;
break;
default:
gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" );
return;
}
-
- ctx->NewState |= _NEW_POINT;
}