mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().
authorPaul Berry <stereotype441@gmail.com>
Tue, 13 Sep 2011 19:07:15 +0000 (12:07 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 23 Sep 2011 20:30:08 +0000 (13:30 -0700)
In order to support 8 clip distances, we need to properly decode when
the user sets the GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7 enable
flags.

For clarity, this patch changes the names GL_CLIP_PLANE[0-5] in the
switch statement to the equivalent names GL_CLIP_DISTANCE[0-5], since
the GL_CLIP_PLANE names are deprecated.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Brian Paul <brianp@vmware.com>
src/mesa/main/enable.c

index ba24ca77c53903f5250fe1f2e4a52679bce66b65..23b6a948055b380647f7218919add87a7d31c4e8 100644 (file)
@@ -295,12 +295,14 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          }
          break;
 #if FEATURE_userclip
-      case GL_CLIP_PLANE0:
-      case GL_CLIP_PLANE1:
-      case GL_CLIP_PLANE2:
-      case GL_CLIP_PLANE3:
-      case GL_CLIP_PLANE4:
-      case GL_CLIP_PLANE5:
+      case GL_CLIP_DISTANCE0:
+      case GL_CLIP_DISTANCE1:
+      case GL_CLIP_DISTANCE2:
+      case GL_CLIP_DISTANCE3:
+      case GL_CLIP_DISTANCE4:
+      case GL_CLIP_DISTANCE5:
+      case GL_CLIP_DISTANCE6:
+      case GL_CLIP_DISTANCE7:
          {
             const GLuint p = cap - GL_CLIP_PLANE0;