Mesa (master): mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().

Paul Berry stereotype441 at kemper.freedesktop.org
Fri Sep 23 22:43:47 UTC 2011


Module: Mesa
Branch: master
Commit: 2d686fe911a89fa477ee3848da41ebfb100500bf
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d686fe911a89fa477ee3848da41ebfb100500bf

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Tue Sep 13 12:07:15 2011 -0700

mesa: Decode GL_CLIP_DISTANCE[67] properly in _mesa_set_enable().

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 at anholt.net>
Tested-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/enable.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index ba24ca7..23b6a94 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -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;
 




More information about the mesa-commit mailing list