[Piglit] [PATCH 05/15] Stop referring to nonstandard enums GL_CLIP_PLANE{6, 7}.

Paul Berry stereotype441 at gmail.com
Fri Mar 2 15:40:23 PST 2012


GL_GLIP_PLANE6 and GL_CLIP_PLANE7 are defined by glew.h, but not by
the standard OpenGL headers.  The standard OpenGL headers name these
constants GL_CLIP_DISTANCE6 and GL_CLIP_DISTANCE7.  Unfortunately, we
can't use those names either, because glew.h uses #defines to prevent
the standard OpenGL headers from having any effect.

To work around this madness, just use GL_CLIP_PLANE0+6 and
GL_CLIP_PLANE_0+7, which work whether or not GLEW is in use.
---
 tests/shaders/shader_runner.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 82d20f4..56881b8 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -920,8 +920,8 @@ struct enable_table {
 	{ "GL_CLIP_PLANE3", GL_CLIP_PLANE3 },
 	{ "GL_CLIP_PLANE4", GL_CLIP_PLANE4 },
 	{ "GL_CLIP_PLANE5", GL_CLIP_PLANE5 },
-	{ "GL_CLIP_PLANE6", GL_CLIP_PLANE6 },
-	{ "GL_CLIP_PLANE7", GL_CLIP_PLANE7 },
+	{ "GL_CLIP_PLANE6", GL_CLIP_PLANE0+6 },
+	{ "GL_CLIP_PLANE7", GL_CLIP_PLANE0+7 },
 	{ "GL_VERTEX_PROGRAM_TWO_SIDE", GL_VERTEX_PROGRAM_TWO_SIDE },
 	{ NULL, 0 }
 };
-- 
1.7.7.6



More information about the Piglit mailing list