summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-05-08 09:12:35 -0600
committerBrian Paul <[email protected]>2012-05-08 12:12:03 -0600
commit2428de1c501f75453248611edd6f717285d3156d (patch)
tree447c8a0c4e9dc33fa42f08f735f2e50e4ba323c5 /src/mesa
parentb13ecbadeae4fc69fe01454e01059d3affa05215 (diff)
mesa: minor clean-ups in dlist material code
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/dlist.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
index 599c6c5b4bf..a90ff33bd30 100644
--- a/src/mesa/main/dlist.c
+++ b/src/mesa/main/dlist.c
@@ -5676,14 +5676,22 @@ save_EdgeFlag(GLboolean x)
save_Attr1fNV(VERT_ATTRIB_EDGEFLAG, x ? (GLfloat)1.0 : (GLfloat)0.0);
}
-static inline GLboolean compare4fv( const GLfloat *a,
- const GLfloat *b,
- GLuint count )
+
+/**
+ * Compare 'count' elements of vectors 'a' and 'b'.
+ * \return GL_TRUE if equal, GL_FALSE if different.
+ */
+static inline GLboolean
+compare_vec(const GLfloat *a, const GLfloat *b, GLuint count)
{
return memcmp( a, b, count * sizeof(GLfloat) ) == 0;
}
-
+
+/**
+ * This glMaterial function is used for glMaterial calls that are outside
+ * a glBegin/End pair. For glMaterial inside glBegin/End, see the VBO code.
+ */
static void GLAPIENTRY
save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
{
@@ -5734,7 +5742,8 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
for (i = 0; i < MAT_ATTRIB_MAX; i++) {
if (bitmask & (1 << i)) {
if (ctx->ListState.ActiveMaterialSize[i] == args &&
- compare4fv(ctx->ListState.CurrentMaterial[i], param, args)) {
+ compare_vec(ctx->ListState.CurrentMaterial[i], param, args)) {
+ /* no change in material value */
bitmask &= ~(1 << i);
}
else {
@@ -5744,8 +5753,7 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param)
}
}
- /* If this call has effect, return early:
- */
+ /* If this call has no effect, return early */
if (bitmask == 0)
return;