[Piglit] [PATCH 4/9] Replace piglit-dispatch with libepoxy.

Eric Anholt eric at anholt.net
Tue Jan 28 18:52:56 PST 2014


libepoxy is based on a similar code-generation idea as
piglit-dispatch, but is distributed as a separate library, uses the
new XML files, and handles EGL and GLX function pointers as well.
---
 CMakeLists.txt                                     |    4 +-
 cmake/piglit_dispatch.cmake                        |   44 -
 src/piglit/gl_wrap.h                               |   67 -
 tests/egl/egl-util.c                               |   10 +-
 .../default-major-version-gl.c                     |    2 -
 .../default-major-version-gles.c                   |    3 -
 .../default-minor-version-gl.c                     |    2 -
 .../default-minor-version-gles.c                   |    7 -
 .../valid-attribute-empty-gl.c                     |    2 -
 .../valid-attribute-empty-gles.c                   |    3 -
 .../valid-attribute-null-gl.c                      |    2 -
 .../valid-attribute-null-gles.c                    |    3 -
 .../spec/egl_khr_create_context/valid-flag-debug.c |   24 -
 .../valid-flag-forward-compatible-gl.c             |    2 -
 .../spec/egl_khr_create_context/verify-gl-flavor.c |   10 -
 tests/general/windowoverlap.c                      |    1 -
 tests/glean/glwrap.h                               |    2 +-
 tests/glean/tbase.h                                |    6 +-
 tests/glx/glx-copy-sub-buffer.c                    |    1 -
 tests/glx/glx-destroycontext-1.c                   |    1 -
 tests/glx/glx-destroycontext-2.c                   |    1 -
 tests/glx/glx-fbo-binding.c                        |    1 -
 tests/glx/glx-make-current.c                       |    1 -
 tests/glx/glx-make-glxdrawable-current.c           |    1 -
 tests/glx/glx-multi-context-ib-1.c                 |    1 -
 tests/glx/glx-multithread-makecurrent-1.c          |    1 -
 tests/glx/glx-multithread-makecurrent-2.c          |    1 -
 tests/glx/glx-multithread-makecurrent-3.c          |    1 -
 tests/glx/glx-multithread-makecurrent-4.c          |    1 -
 tests/glx/glx-multithread-shader-compile.c         |    7 -
 tests/glx/glx-multithread-texture.c                |    1 -
 tests/glx/glx-multithread.c                        |    1 -
 tests/glx/glx-shader-sharing.c                     |    2 -
 tests/glx/glx-swap-event.c                         |    1 -
 tests/glx/glx-swap-pixmap-bad.c                    |    1 -
 tests/glx/glx-swap-pixmap.c                        |    1 -
 tests/glx/glx-swap-singlebuffer.c                  |    1 -
 tests/glx/glx-tfp.c                                |    2 -
 tests/glx/glx-visuals-depth.c                      |    1 -
 tests/glx/glx-visuals-stencil.c                    |    1 -
 .../depth-stencil-texture.c                        |    7 +-
 .../glx_arb_create_context/default-major-version.c |    1 -
 .../glx_arb_create_context/default-minor-version.c |    1 -
 tests/spec/glx_mesa_query_renderer/coverage.c      |    1 -
 tests/spec/glx_oml_sync_control/common.c           |    2 -
 tests/texturing/getteximage-luminance.c            |    1 -
 tests/util/CMakeLists.gl.txt                       |    4 -
 tests/util/CMakeLists.gles2.txt                    |    2 -
 tests/util/CMakeLists.gles3.txt                    |    2 -
 tests/util/CMakeLists.txt                          |    1 +
 tests/util/gen_dispatch.py                         |  682 ---------
 tests/util/glxew.h                                 | 1586 --------------------
 tests/util/piglit-dispatch-init.c                  |  202 ---
 tests/util/piglit-dispatch.c                       |  304 ----
 tests/util/piglit-dispatch.h                       |  175 ---
 .../piglit-framework-gl/piglit_fbo_framework.c     |    2 -
 .../piglit-framework-gl/piglit_glut_framework.c    |    4 -
 .../piglit-framework-gl/piglit_wfl_framework.c     |    6 -
 .../piglit-framework-gl/piglit_x11_framework.c     |   13 +-
 tests/util/piglit-shader.h                         |   45 -
 tests/util/piglit-util-gl-common.h                 |    4 +-
 tests/util/piglit-util-gl.c                        |    2 -
 tests/util/piglit_ktx.h                            |    2 +-
 63 files changed, 13 insertions(+), 3260 deletions(-)
 delete mode 100644 cmake/piglit_dispatch.cmake
 delete mode 100644 src/piglit/gl_wrap.h
 delete mode 100644 tests/util/gen_dispatch.py
 delete mode 100644 tests/util/glxew.h
 delete mode 100644 tests/util/piglit-dispatch-init.c
 delete mode 100644 tests/util/piglit-dispatch.c
 delete mode 100644 tests/util/piglit-dispatch.h

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bef9c35..45d2cc1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,9 @@ option(PIGLIT_BUILD_CL_TESTS "Build tests for OpenCL" OFF)
 
 if(PIGLIT_BUILD_GL_TESTS)
 	find_package(OpenGL REQUIRED)
+	pkg_check_modules(EPOXY REQUIRED epoxy)
+	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EPOXY_CFLAGS}")
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EPOXY_CFLAGS}")
 endif()
 
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -377,7 +380,6 @@ configure_file(
 
 include(cmake/piglit_util.cmake)
 include(cmake/piglit_glapi.cmake)
-include(cmake/piglit_dispatch.cmake)
 
 include_directories(src)
 add_subdirectory(cmake/target_api)
diff --git a/cmake/piglit_dispatch.cmake b/cmake/piglit_dispatch.cmake
deleted file mode 100644
index 0b0a2eb..0000000
--- a/cmake/piglit_dispatch.cmake
+++ /dev/null
@@ -1,44 +0,0 @@
-# Copyright 2012 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-set(piglit_dispatch_gen_output_dir ${CMAKE_BINARY_DIR}/tests/util)
-
-file(MAKE_DIRECTORY ${piglit_dispatch_gen_output_dir})
-
-set(piglit_dispatch_gen_outputs
-	${piglit_dispatch_gen_output_dir}/generated_dispatch.c
-	${piglit_dispatch_gen_output_dir}/generated_dispatch.h
-	)
-
-set(piglit_dispatch_gen_inputs
-	${CMAKE_SOURCE_DIR}/tests/util/gen_dispatch.py
-	${CMAKE_BINARY_DIR}/glapi/glapi.json
-	)
-
-add_custom_command(
-	OUTPUT ${piglit_dispatch_gen_outputs}
-	DEPENDS ${piglit_dispatch_gen_inputs}
-	COMMAND ${python} ${piglit_dispatch_gen_inputs} ${piglit_dispatch_gen_outputs}
-	)
-
-add_custom_target(piglit_dispatch_gen
-	DEPENDS ${piglit_dispatch_gen_outputs}
-	)
diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
deleted file mode 100644
index e8bbbcd..0000000
--- a/src/piglit/gl_wrap.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2010 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- *
- * Authors:
- *     Chad Versace <chad.versace at intel.com>
- */
-
-/**
- * \file gl_wrap.h
- * \brief Convenience header that includes the actual OpenGL headers.
- *
- * The actual OpenGL headers are chosen according to the macro definitions
- * PIGLIT_USE_OPENGL, PIGLIT_USE_OPENGL_ES1, and PIGLIT_USE_OPENGL_ES2.
- */
-
-#pragma once
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _WIN32
-#include <windows.h>
-#endif
-
-#if (defined(PIGLIT_USE_OPENGL) || \
-     defined(PIGLIT_USE_OPENGL_ES2) || \
-     defined(PIGLIT_USE_OPENGL_ES3))
-#	include "piglit-dispatch.h"
-
-#elif defined(PIGLIT_USE_OPENGL_ES1)
-#	define GL_GLEXT_PROTOTYPES
-#	include <GLES/gl.h>
-#	include <GLES/glext.h>
-
-	/* for source level compatibility */
-#       define GL_TEXTURE_CUBE_MAP_POSITIVE_X GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES
-#       define GL_TEXTURE_CUBE_MAP_POSITIVE_Y GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES
-#       define GL_TEXTURE_CUBE_MAP_POSITIVE_Z GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES
-#       define GL_TEXTURE_CUBE_MAP_NEGATIVE_X GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES
-#       define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES
-#       define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES
-
-#endif
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
diff --git a/tests/egl/egl-util.c b/tests/egl/egl-util.c
index 226ba0e..f371666 100644
--- a/tests/egl/egl-util.c
+++ b/tests/egl/egl-util.c
@@ -189,7 +189,7 @@ egl_util_run(const struct egl_test *test, int argc, char *argv[])
 	struct egl_state state;
 	EGLint count;
 	enum piglit_result result;
-	int i, dispatch_api, api_bit = EGL_OPENGL_BIT;
+	int i, api_bit = EGL_OPENGL_BIT;
 
 	EGLint ctxAttribsES[] = {
 		EGL_CONTEXT_CLIENT_VERSION, 0,
@@ -225,18 +225,14 @@ egl_util_run(const struct egl_test *test, int argc, char *argv[])
 		ctxAttribs = ctxAttribsES;
 	}
 
-	/* choose dispatch_api and set ctx version to ctxAttribs if using ES */
+	/* Set ctx version to ctxAttribs if using ES */
 	switch (api_bit) {
 	case EGL_OPENGL_ES_BIT:
-		dispatch_api = PIGLIT_DISPATCH_ES1;
 		ctxAttribsES[1] = 1;
 		break;
 	case EGL_OPENGL_ES2_BIT:
-		dispatch_api = PIGLIT_DISPATCH_ES2;
 		ctxAttribsES[1] = 2;
 		break;
-	default:
-		dispatch_api = PIGLIT_DISPATCH_GL;
 	}
 
 
@@ -283,8 +279,6 @@ egl_util_run(const struct egl_test *test, int argc, char *argv[])
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init(dispatch_api);
-
 	result = event_loop(&state, test);
 
 	eglTerminate(state.egl_dpy);
diff --git a/tests/egl/spec/egl_khr_create_context/default-major-version-gl.c b/tests/egl/spec/egl_khr_create_context/default-major-version-gl.c
index 1162d7b..22cb802 100644
--- a/tests/egl/spec/egl_khr_create_context/default-major-version-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/default-major-version-gl.c
@@ -63,8 +63,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/default-major-version-gles.c b/tests/egl/spec/egl_khr_create_context/default-major-version-gles.c
index 00c28d1..da72fbb 100644
--- a/tests/egl/spec/egl_khr_create_context/default-major-version-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/default-major-version-gles.c
@@ -60,9 +60,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	/* FINISHME: Use PIGLIT_DISPATCH_ES1 when implemented. */
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/default-minor-version-gl.c b/tests/egl/spec/egl_khr_create_context/default-minor-version-gl.c
index 37369d5..2ff3d85 100644
--- a/tests/egl/spec/egl_khr_create_context/default-minor-version-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/default-minor-version-gl.c
@@ -65,8 +65,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c b/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
index 6101ad7..8c4270f 100644
--- a/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c
@@ -64,13 +64,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	if (attribs[1] == 1) {
-		/* FINISHME: Use PIGLIT_DISPATCH_ES1 when implemented. */
-		piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-	} else if (attribs[1] == 2) {
-		piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);
-	}
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gl.c b/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gl.c
index 5e1ebb3..7ae042d 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gl.c
@@ -55,8 +55,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gles.c b/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gles.c
index 1a878a8..b962424 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gles.c
@@ -54,9 +54,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	/* FINISHME: Use PIGLIT_DISPATCH_ES1 when implemented. */
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gl.c b/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gl.c
index d3ff851..04a24c2 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gl.c
@@ -52,8 +52,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gles.c b/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gles.c
index 2042283..706d338 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gles.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-attribute-null-gles.c
@@ -51,9 +51,6 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	/* FINISHME: Use PIGLIT_DISPATCH_ES1 when implemented. */
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	version_string = (char *) glGetString(GL_VERSION);
 
 	if (!parse_version_string(version_string, &major, &minor)) {
diff --git a/tests/egl/spec/egl_khr_create_context/valid-flag-debug.c b/tests/egl/spec/egl_khr_create_context/valid-flag-debug.c
index 1473b44..a8bc1d7 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-flag-debug.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-flag-debug.c
@@ -65,7 +65,6 @@ static void
 try_debug_flag(EGLenum context_api, EGLenum context_bit)
 {
 	GLint actual_flags = 0;
-	piglit_dispatch_api dispatch_api;
 
 	EGLint attribs[64];
 	int i = 0;
@@ -117,29 +116,6 @@ try_debug_flag(EGLenum context_api, EGLenum context_bit)
 
 	switch (context_bit) {
 	case EGL_OPENGL_BIT:
-		dispatch_api = PIGLIT_DISPATCH_GL;
-		break;
-	case EGL_OPENGL_ES_BIT:
-		/* Piglit doesn't yet have ES1 dispatch, so just initialize
-		 * with ES2 dispatch. This should be safe because the only
-		 * GL functions called by this test are glGetString() and
-		 * glGetIntegerv().
-		 */
-		dispatch_api = PIGLIT_DISPATCH_ES2;
-	case EGL_OPENGL_ES2_BIT:
-	case EGL_OPENGL_ES3_BIT_KHR:
-		dispatch_api = PIGLIT_DISPATCH_ES2;
-		break;
-	default:
-		dispatch_api = 0;
-		assert(0);
-		break;
-	}
-
-	piglit_dispatch_default_init(dispatch_api);
-
-	switch (context_bit) {
-	case EGL_OPENGL_BIT:
 		if (piglit_get_gl_version() < 31 &&
 		    !piglit_is_extension_supported("GL_KHR_debug")) {
 			fprintf(stderr, "In OpenGL, either OpenGL 3.1 or "
diff --git a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
index 7f0f148..eef19f2 100644
--- a/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
+++ b/tests/egl/spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c
@@ -43,8 +43,6 @@ static bool try_flag(int flag)
 				piglit_report_result(PIGLIT_FAIL);
 			}
 
-			piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 			gl_version = piglit_get_gl_version();
 		}
 		eglDestroyContext(egl_dpy, ctx);
diff --git a/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c b/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c
index 27ea0b1..ff40eda 100644
--- a/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c
+++ b/tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c
@@ -139,8 +139,6 @@ get_gl_version(void)
 static enum piglit_result
 check_flavor(int requested_version, enum gl_api requested_api)
 {
-	static bool is_dispatch_init = false;
-
 	enum piglit_result result = PIGLIT_PASS;
 	int i;
 
@@ -231,14 +229,6 @@ check_flavor(int requested_version, enum gl_api requested_api)
 		goto fail;
 	}
 
-	if (!is_dispatch_init) {
-		/* We must postpone initialization of piglit-dispatch until
-		 * a context is current.
-		 */
-		piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-		is_dispatch_init = true;
-	}
-
 	if (!eglQueryContext(egl_dpy, ctx,
 			     EGL_CONTEXT_CLIENT_TYPE, &actual_client_type)) {
 		printf("%s", "error: eglQueryContext(EGL_CONTEXT_CLIENT_TYPE) "
diff --git a/tests/general/windowoverlap.c b/tests/general/windowoverlap.c
index 6b08a75..71e70f6 100644
--- a/tests/general/windowoverlap.c
+++ b/tests/general/windowoverlap.c
@@ -181,7 +181,6 @@ int main(int argc, char *argv[])
 	glutInitWindowSize(MainWidth, MainHeight);
 	glutInitDisplayMode(PIGLIT_GL_VISUAL_RGB);
 	glutCreateWindow(argv[0]);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glutReshapeFunc(Reshape);
 	glutDisplayFunc(RedisplayMain);
 	if (!Automatic)
diff --git a/tests/glean/glwrap.h b/tests/glean/glwrap.h
index d3404b4..cfc2ee5 100644
--- a/tests/glean/glwrap.h
+++ b/tests/glean/glwrap.h
@@ -48,7 +48,7 @@
 #ifndef __glwrap_h__
 #define __glwrap_h__
 
-#include "../util/piglit-dispatch.h"
+#include <epoxy/gl.h>
 
 #if defined(__WIN__)
 #  include <windows.h>
diff --git a/tests/glean/tbase.h b/tests/glean/tbase.h
index b5fe2c5..37a65c2 100644
--- a/tests/glean/tbase.h
+++ b/tests/glean/tbase.h
@@ -104,7 +104,7 @@ and tbasic.cpp.
 #ifndef __tbase_h__
 #define __tbase_h__
 
-#include "piglit-dispatch.h"
+#include <epoxy/gl.h>
 
 #ifdef __UNIX__
 #include <unistd.h>
@@ -311,10 +311,6 @@ public:
 					// XXX need to throw exception here
 				}
 
-				// Make sure glew is initialized so we can call
-				// GL functions safely.
-				piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 				// Check if test is applicable to this context
 				if (!isApplicable())
 					continue;
diff --git a/tests/glx/glx-copy-sub-buffer.c b/tests/glx/glx-copy-sub-buffer.c
index a991df5..ef8bd93 100644
--- a/tests/glx/glx-copy-sub-buffer.c
+++ b/tests/glx/glx-copy-sub-buffer.c
@@ -52,7 +52,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win_one, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	glClearColor(1.0, 0.0, 0.0, 0.0);
 	glClear(GL_COLOR_BUFFER_BIT);
diff --git a/tests/glx/glx-destroycontext-1.c b/tests/glx/glx-destroycontext-1.c
index fc27b6e..3088d5b 100644
--- a/tests/glx/glx-destroycontext-1.c
+++ b/tests/glx/glx-destroycontext-1.c
@@ -48,7 +48,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glClearColor(1.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	glXMakeCurrent(dpy, None, NULL);
diff --git a/tests/glx/glx-destroycontext-2.c b/tests/glx/glx-destroycontext-2.c
index e4c6d37..0edfbb9 100644
--- a/tests/glx/glx-destroycontext-2.c
+++ b/tests/glx/glx-destroycontext-2.c
@@ -48,7 +48,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glClearColor(1.0, 0.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
 	glXDestroyContext(dpy, ctx);
diff --git a/tests/glx/glx-fbo-binding.c b/tests/glx/glx-fbo-binding.c
index bfdc4dd..6fb051e 100644
--- a/tests/glx/glx-fbo-binding.c
+++ b/tests/glx/glx-fbo-binding.c
@@ -111,7 +111,6 @@ main(int argc, char **argv)
    ctx = piglit_get_glx_context(dpy, visinfo);
 
    glXMakeCurrent(dpy, Windows[0], ctx);
-   piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
    piglit_glx_event_loop(dpy, draw);
 
diff --git a/tests/glx/glx-make-current.c b/tests/glx/glx-make-current.c
index dde99b4..0f09060 100644
--- a/tests/glx/glx-make-current.c
+++ b/tests/glx/glx-make-current.c
@@ -49,7 +49,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win_one, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	glClearColor(0.0, 1.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
diff --git a/tests/glx/glx-make-glxdrawable-current.c b/tests/glx/glx-make-glxdrawable-current.c
index fc339be..2a6d778 100644
--- a/tests/glx/glx-make-glxdrawable-current.c
+++ b/tests/glx/glx-make-glxdrawable-current.c
@@ -76,7 +76,6 @@ draw(Display *dpy)
 	ctx = piglit_get_glx_context(dpy, visinfo);
 
 	glXMakeCurrent(dpy, glxwin_one, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	glClearColor(0.0, 1.0, 0.0, 1.0);
 	glClear(GL_COLOR_BUFFER_BIT);
diff --git a/tests/glx/glx-multi-context-ib-1.c b/tests/glx/glx-multi-context-ib-1.c
index 2b3c00e..6a4ce3f 100644
--- a/tests/glx/glx-multi-context-ib-1.c
+++ b/tests/glx/glx-multi-context-ib-1.c
@@ -189,7 +189,6 @@ main(int argc, char **argv)
 	ctx1 = piglit_get_glx_context(dpy, visinfo);
 
 	glXMakeCurrent(dpy, win, ctx0);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	piglit_require_extension("GL_ARB_vertex_buffer_object");
 	context0_init();
 	glXMakeCurrent(dpy, win, ctx1);
diff --git a/tests/glx/glx-multithread-makecurrent-1.c b/tests/glx/glx-multithread-makecurrent-1.c
index 97dc1cd..d9d689b 100644
--- a/tests/glx/glx-multithread-makecurrent-1.c
+++ b/tests/glx/glx-multithread-makecurrent-1.c
@@ -107,7 +107,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	piglit_require_glx_extension(dpy, "MESA_multithread_makecurrent");
 
diff --git a/tests/glx/glx-multithread-makecurrent-2.c b/tests/glx/glx-multithread-makecurrent-2.c
index d9714ec..adb1e98 100644
--- a/tests/glx/glx-multithread-makecurrent-2.c
+++ b/tests/glx/glx-multithread-makecurrent-2.c
@@ -108,7 +108,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	piglit_require_glx_extension(dpy, "MESA_multithread_makecurrent");
 
diff --git a/tests/glx/glx-multithread-makecurrent-3.c b/tests/glx/glx-multithread-makecurrent-3.c
index dc93d33..3a5524d 100644
--- a/tests/glx/glx-multithread-makecurrent-3.c
+++ b/tests/glx/glx-multithread-makecurrent-3.c
@@ -100,7 +100,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	piglit_require_glx_extension(dpy, "MESA_multithread_makecurrent");
 
diff --git a/tests/glx/glx-multithread-makecurrent-4.c b/tests/glx/glx-multithread-makecurrent-4.c
index 53cb297..f2d0cc2 100644
--- a/tests/glx/glx-multithread-makecurrent-4.c
+++ b/tests/glx/glx-multithread-makecurrent-4.c
@@ -100,7 +100,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	piglit_require_glx_extension(dpy, "MESA_multithread_makecurrent");
 
diff --git a/tests/glx/glx-multithread-shader-compile.c b/tests/glx/glx-multithread-shader-compile.c
index 82042d5..61a6250 100644
--- a/tests/glx/glx-multithread-shader-compile.c
+++ b/tests/glx/glx-multithread-shader-compile.c
@@ -68,13 +68,6 @@ thread_func(void *arg)
 		ctx = piglit_get_glx_context(dpy, visinfo);
 		glXMakeCurrent(dpy, win, ctx);
 
-		/* Ok, not nice but should be safe due to all threads working
-		 * on the same type of context.
-                 */
-		pthread_mutex_lock(&mutex);
-		piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-		pthread_mutex_unlock(&mutex);
-
 		vert_shader = piglit_compile_shader_text(GL_VERTEX_SHADER, vert_shader_text);
 		piglit_check_gl_error(GL_NO_ERROR);
 
diff --git a/tests/glx/glx-multithread-texture.c b/tests/glx/glx-multithread-texture.c
index 59dc730..af17ce1 100644
--- a/tests/glx/glx-multithread-texture.c
+++ b/tests/glx/glx-multithread-texture.c
@@ -195,7 +195,6 @@ draw(Display *dpy)
 
 	ret = glXMakeCurrent(dpy, draw_win, my_ctx);
 	assert(ret);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	glEnable(GL_TEXTURE_2D);
 
diff --git a/tests/glx/glx-multithread.c b/tests/glx/glx-multithread.c
index f88f8da..133544d 100644
--- a/tests/glx/glx-multithread.c
+++ b/tests/glx/glx-multithread.c
@@ -79,7 +79,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	/* Clear background to gray */
 	glClearColor(0.5, 0.5, 0.5, 1.0);
diff --git a/tests/glx/glx-shader-sharing.c b/tests/glx/glx-shader-sharing.c
index 1b180ae..4a78ac0 100644
--- a/tests/glx/glx-shader-sharing.c
+++ b/tests/glx/glx-shader-sharing.c
@@ -88,8 +88,6 @@ draw(Display *dpy)
     */
    glXMakeCurrent(dpy, win, ctx1);
 
-   piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
    if (piglit_get_gl_version() < 20) {
       printf("%s: Requires OpenGL 2.0\n", TestName);
       return PIGLIT_SKIP;
diff --git a/tests/glx/glx-swap-event.c b/tests/glx/glx-swap-event.c
index 310e634..8b2eb0c 100644
--- a/tests/glx/glx-swap-event.c
+++ b/tests/glx/glx-swap-event.c
@@ -533,7 +533,6 @@ main(int argc, char *argv[])
             piglit_report_result(PIGLIT_FAIL);
         }
     }
-    piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
     event_loop(dpy, glxWin);
     
     glXDestroyContext(dpy, ctx);
diff --git a/tests/glx/glx-swap-pixmap-bad.c b/tests/glx/glx-swap-pixmap-bad.c
index 52a0749..2b4133e 100644
--- a/tests/glx/glx-swap-pixmap-bad.c
+++ b/tests/glx/glx-swap-pixmap-bad.c
@@ -73,7 +73,6 @@ main(int argc, char **argv)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, g, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	/* Clear to green */
 	glClearColor(0.0, 1.0, 0.0, 0.0);
diff --git a/tests/glx/glx-swap-pixmap.c b/tests/glx/glx-swap-pixmap.c
index 7635e0d..51aebfe 100644
--- a/tests/glx/glx-swap-pixmap.c
+++ b/tests/glx/glx-swap-pixmap.c
@@ -67,7 +67,6 @@ main(int argc, char **argv)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, g, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	/* Clear to green */
 	glClearColor(0.0, 1.0, 0.0, 0.0);
diff --git a/tests/glx/glx-swap-singlebuffer.c b/tests/glx/glx-swap-singlebuffer.c
index a747149..b7c2e75 100644
--- a/tests/glx/glx-swap-singlebuffer.c
+++ b/tests/glx/glx-swap-singlebuffer.c
@@ -48,7 +48,6 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	/* Clear to green */
 	glClearColor(0.0, 1.0, 0.0, 0.0);
diff --git a/tests/glx/glx-tfp.c b/tests/glx/glx-tfp.c
index 413d920..3336c51 100644
--- a/tests/glx/glx-tfp.c
+++ b/tests/glx/glx-tfp.c
@@ -320,8 +320,6 @@ int main(int argc, char**argv)
 
 	glXMakeCurrent(dpy, win, ctx);
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	if (piglit_automatic)
 		piglit_glx_set_no_input();
 
diff --git a/tests/glx/glx-visuals-depth.c b/tests/glx/glx-visuals-depth.c
index 8db98bb..38c3a27 100644
--- a/tests/glx/glx-visuals-depth.c
+++ b/tests/glx/glx-visuals-depth.c
@@ -50,7 +50,6 @@ draw(Display *dpy, GLXFBConfig config)
 	float *left, *right;
 	bool pass = true;
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glXGetFBConfigAttrib(dpy, config, GLX_DEPTH_SIZE, &dbits);
 
 	piglit_ortho_projection(piglit_width, piglit_height, false);
diff --git a/tests/glx/glx-visuals-stencil.c b/tests/glx/glx-visuals-stencil.c
index 12fcfd3..9da3b33 100644
--- a/tests/glx/glx-visuals-stencil.c
+++ b/tests/glx/glx-visuals-stencil.c
@@ -50,7 +50,6 @@ draw(Display *dpy, GLXFBConfig config)
 	float *left, *right;
 	bool pass = true;
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glXGetFBConfigAttrib(dpy, config, GLX_STENCIL_SIZE, &sbits);
 
 	piglit_ortho_projection(piglit_width, piglit_height, false);
diff --git a/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c b/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
index d40d6a6..369f80e 100644
--- a/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
+++ b/tests/spec/ext_packed_depth_stencil/depth-stencil-texture.c
@@ -57,11 +57,8 @@ PIGLIT_GL_TEST_CONFIG_BEGIN
 PIGLIT_GL_TEST_CONFIG_END
 
 #if defined PIGLIT_USE_OPENGL_ES1
-#define GL_TEXTURE_CUBE_MAP  GL_TEXTURE_CUBE_MAP_OES
-#define GL_DEPTH_STENCIL     GL_DEPTH_STENCIL_OES
-#define GL_DEPTH24_STENCIL8  GL_DEPTH24_STENCIL8_OES
-#define GL_UNSIGNED_INT_24_8 GL_UNSIGNED_INT_24_8_OES
-#define GL_TEXTURE_3D        0x806F
+/* XXX: This should get propagated to gl.xml */
+#undef glTexStorage2D
 #define glTexStorage2D       glTexStorage2DEXT
 #endif
 
diff --git a/tests/spec/glx_arb_create_context/default-major-version.c b/tests/spec/glx_arb_create_context/default-major-version.c
index 07bff27..6f0bc4d 100644
--- a/tests/spec/glx_arb_create_context/default-major-version.c
+++ b/tests/spec/glx_arb_create_context/default-major-version.c
@@ -52,7 +52,6 @@ int main(int argc, char **argv)
 	 */
 	ctx = glXCreateContextAttribsARB(dpy, fbconfig, NULL, True, attribs);
 	glXMakeContextCurrent(dpy, glxWin, glxWin, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
diff --git a/tests/spec/glx_arb_create_context/default-minor-version.c b/tests/spec/glx_arb_create_context/default-minor-version.c
index f32e991..e442fe0 100644
--- a/tests/spec/glx_arb_create_context/default-minor-version.c
+++ b/tests/spec/glx_arb_create_context/default-minor-version.c
@@ -57,7 +57,6 @@ int main(int argc, char **argv)
 	}
 
 	glXMakeContextCurrent(dpy, glxWin, glxWin, ctx);
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
diff --git a/tests/spec/glx_mesa_query_renderer/coverage.c b/tests/spec/glx_mesa_query_renderer/coverage.c
index b3464d4..387da93 100644
--- a/tests/spec/glx_mesa_query_renderer/coverage.c
+++ b/tests/spec/glx_mesa_query_renderer/coverage.c
@@ -264,7 +264,6 @@ int main(int argc, char **argv)
 	}
 
         glXMakeContextCurrent(dpy, glxWin, glxWin, ctx);
-        piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	pass = subtest_QueryRendererInteger(dpy) && pass;
 	pass = subtest_QueryRendererString(dpy) && pass;
diff --git a/tests/spec/glx_oml_sync_control/common.c b/tests/spec/glx_oml_sync_control/common.c
index d5011a8..922f080 100644
--- a/tests/spec/glx_oml_sync_control/common.c
+++ b/tests/spec/glx_oml_sync_control/common.c
@@ -80,8 +80,6 @@ piglit_oml_sync_control_test_run(enum piglit_result (*draw)(Display *dpy))
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	XMapWindow(dpy, win);
 
 	piglit_glx_event_loop(dpy, draw);
diff --git a/tests/texturing/getteximage-luminance.c b/tests/texturing/getteximage-luminance.c
index 389c3a2..e8631a8 100644
--- a/tests/texturing/getteximage-luminance.c
+++ b/tests/texturing/getteximage-luminance.c
@@ -251,5 +251,4 @@ piglit_display(void)
 void
 piglit_init(int argc, char **argv)
 {
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 }
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index d8fb32c..ba83d84 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -1,7 +1,5 @@
 set(UTIL_GL_SOURCES
 	${UTIL_GL_SOURCES}
-	piglit-dispatch.c
-	piglit-dispatch-init.c
 	piglit-shader.c
 	piglit-shader-gl.c
 	piglit-util-gl-enum.c
@@ -37,8 +35,6 @@ IF(PIGLIT_BUILD_GLX_TESTS)
 		    piglit-util-gl.c
 		    piglit-glx-framework.c
 		    piglit-glx-util.c
-		    piglit-dispatch.c
-		    piglit-dispatch-init.c
 	)
 	target_link_libraries(piglitglxutil
 		piglitutil_${piglit_target_api}
diff --git a/tests/util/CMakeLists.gles2.txt b/tests/util/CMakeLists.gles2.txt
index d2501e3..0470104 100644
--- a/tests/util/CMakeLists.gles2.txt
+++ b/tests/util/CMakeLists.gles2.txt
@@ -1,8 +1,6 @@
 set(UTIL_GL_SOURCES
 	${UTIL_GL_SOURCES}
 	piglit-vbo.cpp
-	piglit-dispatch.c
-	piglit-dispatch-init.c
 	piglit-shader.c
 	piglit-shader-gles2.c
 	piglit-util-gl-enum.c
diff --git a/tests/util/CMakeLists.gles3.txt b/tests/util/CMakeLists.gles3.txt
index 1cb591f..98f3302 100644
--- a/tests/util/CMakeLists.gles3.txt
+++ b/tests/util/CMakeLists.gles3.txt
@@ -1,7 +1,5 @@
 list(APPEND UTIL_GL_SOURCES
 	minmax-test.c
-	piglit-dispatch.c
-	piglit-dispatch-init.c
 	piglit-shader.c
 	piglit-shader-gles2.c # Compatible with gles3.
 	piglit-util-gles.c
diff --git a/tests/util/CMakeLists.txt b/tests/util/CMakeLists.txt
index 27c8888..691adc4 100644
--- a/tests/util/CMakeLists.txt
+++ b/tests/util/CMakeLists.txt
@@ -52,6 +52,7 @@ endif()
 set(UTIL_GL_LIBS
 	piglitutil
 	${WAFFLE_LDFLAGS}
+	${EPOXY_LDFLAGS}
 	)
 
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
diff --git a/tests/util/gen_dispatch.py b/tests/util/gen_dispatch.py
deleted file mode 100644
index c97af94..0000000
--- a/tests/util/gen_dispatch.py
+++ /dev/null
@@ -1,682 +0,0 @@
-# Copyright 2012 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-
-# This script generates a C file (and corresponding header) allowing
-# Piglit to dispatch calls to OpenGL based on a JSON description of
-# the GL API (and extensions).
-#
-# Invoke this script with 3 command line arguments: the JSON input
-# filename, the C output filename, and the header outpit filename.
-#
-#
-# The input looks like this:
-#
-# {
-#   "categories": {
-#     <category name>: {
-#       "kind": <"GL" or "GLES" for a GL spec API, "extension" for an extension>,
-#       "gl_10x_version": <For a GL version, version number times 10>,
-#       "extension_name" <For an extension, name of the extension>
-#     }, ...
-#   },
-#   "enums": {
-#     <enum name, without "GL_" prefix>: {
-#       "value_int": <value integer>
-#       "value_str": <value string>
-#     }, ...
-#   },
-#   "functions": {
-#     <function name, without "gl" prefix>: {
-#       "categories": <list of categories in which this function appears>,
-#       "param_names": <list of param names>,
-#       "param_types": <list of param types>,
-#       "return_type": <type, or "void" if no return>
-#     }, ...
-#   },
-#   "function_alias_sets": {
-#     <list of synonymous function names>, ...
-#   },
-# }
-#
-#
-# The generated header consists of the following:
-#
-# - A typedef for each function, of the form that would normally
-#   appear in gl.h or glext.h, e.g.:
-#
-#   typedef GLvoid * (APIENTRY *PFNGLMAPBUFFERPROC)(GLenum, GLenum);
-#   typedef GLvoid * (APIENTRY *PFNGLMAPBUFFERARBPROC)(GLenum, GLenum);
-#
-# - A set of extern declarations for "dispatch function pointers".
-#   There is one dispatch function pointer for each set of synonymous
-#   functions in the GL API, e.g.:
-#
-#   extern PFNGLMAPBUFFERPROC piglit_dispatch_glMapBuffer;
-#
-# - A set of #defines mapping each function name to the corresponding
-#   dispatch function pointer, e.g.:
-#
-#   #define glMapBuffer piglit_dispatch_glMapBuffer
-#   #define glMapBufferARB piglit_dispatch_glMapBuffer
-#
-# - A #define for each enum in the GL API, e.g.:
-#
-#   #define GL_FRONT 0x0404
-#
-# - A #define for each extension, e.g.:
-#
-#   #define GL_ARB_vertex_buffer_object 1
-#
-# - A #define for each known GL version, e.g.:
-#
-#   #define GL_VERSION_1_5 1
-#
-#
-# The generated C file consists of the following:
-#
-# - A resolve function corresponding to each set of synonymous
-#   functions in the GL API.  The resolve function determines which of
-#   the synonymous names the implementation supports (by consulting
-#   the current GL version and/or the extension string), and calls
-#   either get_core_proc() or get_ext_proc() to get the function
-#   pointer.  It stores the result in the dispatch function pointer,
-#   and then returns it as a generic void(void) function pointer.  If
-#   the implementation does not support any of the synonymous names,
-#   it calls unsupported().  E.g.:
-#
-#   /* glMapBuffer (GL 1.5) */
-#   /* glMapbufferARB (GL_ARB_vertex_buffer_object) */
-#   static piglit_dispatch_function_ptr resolve_glMapBuffer()
-#   {
-#     if (check_version(15))
-#       piglit_dispatch_glMapBuffer = (PFNGLMAPBUFFERPROC) get_core_proc("glMapBuffer", 15);
-#     else if (check_extension("GL_ARB_vertex_buffer_object"))
-#       piglit_dispatch_glMapBuffer = (PFNGLMAPBUFFERARBPROC) get_ext_proc("glMapBufferARB");
-#     else
-#       unsupported("MapBuffer");
-#     return (piglit_dispatch_function_ptr) piglit_dispatch_glMapBuffer;
-#   }
-#
-# - A stub function corresponding to each set of synonymous functions
-#   in the GL API.  The stub function first calls
-#   check_initialized().  Then it calls the resolve function to
-#   ensure that the dispatch function pointer is set.  Finally, it
-#   dispatches to the GL function through the dispatch function
-#   pointer.  E.g.:
-#
-#   static GLvoid * APIENTRY stub_glMapBuffer(GLenum target, GLenum access)
-#   {
-#     check_initialized();
-#     resolve_glMapBuffer();
-#     return piglit_dispatch_glMapBuffer(target, access);
-#   }
-#
-# - A declaration for each dispatch function pointer, e.g.:
-#
-#   PFNGLMAPBUFFERPROC piglit_dispatch_glMapBuffer = stub_glMapBuffer;
-#
-# - An function, reset_dispatch_pointers(), which resets each dispatch
-#   pointer to the corresponding stub function.
-#
-# - A table function_names, containing the name of each function in
-#   alphabetical order (including the "gl" prefix).
-#
-# - A table function_resolvers, containing a pointer to the resolve
-#   function corresponding to each entry in function_names.
-
-import collections
-import os.path
-import sys
-try:
-    import simplejson as json
-except:
-    import json
-
-
-# Generate a top-of-file comment cautioning that the file is
-# auto-generated and should not be manually edited.
-def generated_boilerplate():
-    return """\
-/**
- * This file was automatically generated by the script {0!r}.
- *
- * DO NOT EDIT!
- *
- * To regenerate, run "make piglit_dispatch_gen" from the toplevel directory.
- *
- * Copyright 2012 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-""".format(os.path.basename(sys.argv[0]))
-
-
-# Certain param names used in OpenGL are reserved by some compilers.
-# Rename them.
-PARAM_NAME_FIXUPS = {'near': 'hither', 'far': 'yon'}
-
-
-def fixup_param_name(name):
-    if name in PARAM_NAME_FIXUPS:
-        return PARAM_NAME_FIXUPS[name]
-    else:
-        return name
-
-
-# Internal representation of a category.
-#
-# - For a category representing a GL version, Category.kind is 'GL'
-#   and Category.gl_10x_version is 10 times the GL version (e.g. 21
-#   for OpenGL version 2.1).
-#
-# - For a category representing an extension, Category.kind is
-#   'extension' and Category.extension_name is the extension name
-#   (including the 'GL_' prefix).
-class Category(object):
-    def __init__(self, json_data):
-        self.kind = json_data['kind']
-        if 'gl_10x_version' in json_data:
-            self.gl_10x_version = json_data['gl_10x_version']
-        if 'extension_name' in json_data:
-            self.extension_name = json_data['extension_name']
-
-    # Generate a human-readable representation of the category (for
-    # use in generated comments).
-    def __str__(self):
-        if self.kind == 'GL':
-            return 'GL {0}.{1}'.format(
-                self.gl_10x_version // 10, self.gl_10x_version % 10)
-        if self.kind == 'GLES':
-            return 'GLES {0}.{1}'.format(
-                self.gl_10x_version // 10, self.gl_10x_version % 10)
-        elif self.kind == 'extension':
-            return self.extension_name
-        else:
-            raise Exception(
-                'Unexpected category kind {0!r}'.format(self.kind))
-
-
-# Internal representation of a GL function.
-#
-# - Function.name is the name of the function, without the 'gl'
-#   prefix.
-#
-# - Function.param_names is a list containing the name of each
-#   function parameter.
-#
-# - Function.param_types is a list containing the type of each
-#   function parameter.
-#
-# - Function.return_type is the return type of the function, or 'void'
-#   if the function has no return.
-#
-# - Function.category is a Category object describing the extension or
-#   GL version the function is defined in.
-class Function(object):
-    def __init__(self, name, json_data):
-        self.name = name
-        self.param_names = [
-            fixup_param_name(x) for x in json_data['param_names']]
-        self.param_types = json_data['param_types']
-        self.return_type = json_data['return_type']
-        self.categories = json_data['categories']
-
-    # Name of the function, with the 'gl' prefix.
-    @property
-    def gl_name(self):
-        return 'gl' + self.name
-
-    # Name of the function signature typedef corresponding to this
-    # function.  E.g. for the glGetString function, this is
-    # 'PFNGLGETSTRINGPROC'.
-    @property
-    def typedef_name(self):
-        return 'pfn{0}proc'.format(self.gl_name).upper()
-
-    # Generate a string representing the function signature in C.
-    #
-    # - name is inserted before the opening paren--use '' to generate
-    #   an anonymous function type signature.
-    #
-    # - If anonymous_args is True, then the signature contains only
-    #   the types of the arguments, not the names.
-    def c_form(self, name, anonymous_args):
-        if self.param_types:
-            if anonymous_args:
-                param_decls = ', '.join(self.param_types)
-            else:
-                param_decls = ', '.join(
-                    '{0} {1}'.format(*p)
-                    for p in zip(self.param_types, self.param_names))
-        else:
-            param_decls = 'void'
-        return '{rettype} {name}({param_decls})'.format(
-            rettype=self.return_type, name=name,
-            param_decls=param_decls)
-
-
-# Internal representation of an enum.
-#
-# - Enum.value_int is the value of the enum, as a Python integer.
-#
-# - Enum.value_str is the value of the enum, as a string suitable for
-#   emitting as C code.
-class Enum(object):
-    def __init__(self, json_data):
-        self.value_int = json_data['value_int']
-        self.value_str = json_data['value_str']
-
-
-# Data structure keeping track of a set of synonymous functions.  Such
-# a set is called a "dispatch set" because it corresponds to a single
-# dispatch pointer.
-#
-# - DispatchSet.cat_fn_pairs is a list of pairs (category, function)
-#   for each category this function is defined in.  The list is sorted
-#   by category, with categories of kind 'GL' and then 'GLES' appearing first.
-class DispatchSet(object):
-    # Initialize a dispatch set given a list of synonymous function
-    # names.
-    #
-    # - all_functions is a dict mapping all possible function names to
-    #   the Function object describing them.
-    #
-    # - all_categories is a dict mapping all possible category names
-    #   to the Category object describing them.
-    def __init__(self, synonym_set, all_functions, all_categories):
-        self.cat_fn_pairs = []
-        for function_name in synonym_set:
-            function = all_functions[function_name]
-            for category_name in function.categories:
-                category = all_categories[category_name]
-                self.cat_fn_pairs.append((category, function))
-        # Sort by category, with GL categories preceding extensions.
-        self.cat_fn_pairs.sort(key=self.__sort_key)
-
-    # The first Function object in DispatchSet.functions.  This
-    # "primary" function is used to name the dispatch pointer, the
-    # stub function, and the resolve function.
-    @property
-    def primary_function(self):
-        return self.cat_fn_pairs[0][1]
-
-    # The name of the dispatch pointer that should be generated for
-    # this dispatch set.
-    @property
-    def dispatch_name(self):
-        return 'piglit_dispatch_' + self.primary_function.gl_name
-
-    # The name of the stub function that should be generated for this
-    # dispatch set.
-    @property
-    def stub_name(self):
-        return 'stub_' + self.primary_function.gl_name
-
-    # The name of the resolve function that should be generated for
-    # this dispatch set.
-    @property
-    def resolve_name(self):
-        return 'resolve_' + self.primary_function.gl_name
-
-    @staticmethod
-    def __sort_key(cat_fn_pair):
-        if cat_fn_pair[0].kind == 'GL':
-            return 0, cat_fn_pair[0].gl_10x_version
-        elif cat_fn_pair[0].kind == 'GLES':
-            return 1, cat_fn_pair[0].gl_10x_version
-        elif cat_fn_pair[0].kind == 'extension':
-            return 2, cat_fn_pair[0].extension_name
-        else:
-            raise Exception(
-                'Unexpected category kind {0!r}'.format(cat_fn_pair[0].kind))
-
-
-# Data structure keeping track of all of the known functions and
-# enums, and synonym relationships that exist between the functions.
-#
-# - Api.enums is a dict mapping enum name to an Enum object.
-#
-# - Api.functions is a dict mapping function name to a Function object.
-#
-# - Api.function_alias_sets is a list of lists, where each constituent
-#   list is a list of function names that are aliases of each other.
-#
-# - Api.categories is a dict mapping category name to a Category
-#   object.
-class Api(object):
-    def __init__(self, json_data):
-        self.enums = dict(
-            (key, Enum(value))
-            for key, value in json_data['enums'].items())
-        self.functions = dict(
-            (key, Function(key, value))
-            for key, value in json_data['functions'].items())
-        self.function_alias_sets = json_data['function_alias_sets']
-        self.categories = dict(
-            (key, Category(value))
-            for key, value in json_data['categories'].items())
-
-    # Generate a list of (name, value) pairs representing all enums in
-    # the API.  The resulting list is sorted by enum value.
-    def compute_unique_enums(self):
-        enums_by_value = [(enum.value_int, (name, enum.value_str))
-                          for name, enum in self.enums.items()]
-        enums_by_value.sort()
-        return [item[1] for item in enums_by_value]
-
-    # A list of all of the extension names declared in the API, as
-    # Python strings, sorted alphabetically.
-    @property
-    def extensions(self):
-        return sorted(
-            [category_name
-             for category_name, category in self.categories.items()
-             if category.kind == 'extension'])
-
-    # A list of all of the GL versions declared in the API, as
-    # integers (e.g. 13 represents GL version 1.3).
-    @property
-    def gl_versions(self):
-        return sorted(
-            [category.gl_10x_version
-             for category in self.categories.values()
-             if category.kind == 'GL'])
-
-    # Generate a list of DispatchSet objects representing all sets of
-    # synonymous functions in the API.  The resulting list is sorted
-    # by DispatchSet.stub_name.
-    def compute_dispatch_sets(self):
-        sets = [DispatchSet(synonym_set, self.functions, self.categories)
-                for synonym_set in self.function_alias_sets]
-        sets.sort(key=lambda ds: ds.stub_name)
-
-        return sets
-
-    # Generate a list of Function objects representing all functions
-    # in the API.  The resulting list is sorted by function name.
-    def compute_unique_functions(self):
-        return [self.functions[key] for key in sorted(self.functions.keys())]
-
-
-# Read the given input file and return an Api object containing the
-# data in it.
-def read_api(filename):
-    with open(filename, 'r') as f:
-        return Api(json.load(f))
-
-
-# Generate the resolve function for a given DispatchSet.
-def generate_resolve_function(ds):
-    f0 = ds.primary_function
-
-    # First figure out all the conditions we want to check in order to
-    # figure out which function to dispatch to, and the code we will
-    # execute in each case.
-    condition_code_pairs = []
-    for category, f in ds.cat_fn_pairs:
-        if category.kind in ('GL', 'GLES'):
-            getter = 'get_core_proc("{0}", {1})'.format(
-                f.gl_name, category.gl_10x_version)
-
-            condition = ''
-            api_base_version = 0
-            if category.kind == 'GL':
-                condition = 'dispatch_api == PIGLIT_DISPATCH_GL'
-                api_base_version = 10
-            elif category.gl_10x_version >= 20:
-                condition = 'dispatch_api == PIGLIT_DISPATCH_ES2'
-                api_base_version = 20
-            else:
-                condition = 'dispatch_api == PIGLIT_DISPATCH_ES1'
-                api_base_version = 11
-
-            # Only check the version for functions that aren't part of the
-            # core for the PIGLIT_DISPATCH api.
-            if category.gl_10x_version != api_base_version:
-                condition = condition + ' && check_version({0})'.format(
-                    category.gl_10x_version)
-        elif category.kind == 'extension':
-            getter = 'get_ext_proc("{0}")'.format(f.gl_name)
-            condition = 'check_extension("{0}")'.format(category.extension_name)
-        else:
-            raise Exception(
-                'Unexpected category type {0!r}'.format(category.kind))
-
-        if f.name == 'TexImage3DEXT':
-            # Special case: glTexImage3DEXT has a slightly different
-            # type than glTexImage3D (argument 3 is a GLenum rather
-            # than a GLint).  This is not a problem, since GLenum and
-            # GLint are treated identically by function calling
-            # conventions.  So when calling get_proc_address() on
-            # glTexImage3DEXT, cast the result to PFNGLTEXIMAGE3DPROC
-            # to avoid a warning.
-            typedef_name = 'PFNGLTEXIMAGE3DPROC'
-        else:
-            typedef_name = f.typedef_name
-
-        code = '{0} = ({1}) {2};'.format(
-            ds.dispatch_name, typedef_name, getter)
-
-        condition_code_pairs.append((condition, code))
-
-    # XXX: glDraw{Arrays,Elements}InstancedARB are exposed by
-    # ARB_instanced_arrays in addition to ARB_draw_instanced, but neither
-    # gl.spec nor gl.json can accomodate an extension with two categories, so
-    # insert these cases here.
-        if f.gl_name in ('glDrawArraysInstancedARB',
-                         'glDrawElementsInstancedARB'):
-            condition = 'check_extension("GL_ARB_instanced_arrays")'
-            condition_code_pairs.append((condition, code))
-
-    # Finally, if none of the previous conditions were satisfied, then
-    # the given dispatch set is not supported by the implementation,
-    # so we want to call the unsupported() function.
-    condition_code_pairs.append(
-        ('true', 'unsupported("{0}");'.format(f0.name)))
-
-    # Start the resolve function
-    resolve_fn = 'static piglit_dispatch_function_ptr {0}()\n'.format(
-        ds.resolve_name)
-    resolve_fn += '{\n'
-
-    # Output code that checks each condition in turn and executes the
-    # appropriate case.  To make the generated code more palatable
-    # (and to avoid compiler warnings), we convert "if (true) FOO;" to
-    # "FOO;" and "else if (true) FOO;" to "else FOO;".
-    if condition_code_pairs[0][0] == 'true':
-        resolve_fn += '\t{0}\n'.format(condition_code_pairs[0][1])
-    else:
-        resolve_fn += '\tif ({0})\n\t\t{1}\n'.format(*condition_code_pairs[0])
-        for i in xrange(1, len(condition_code_pairs)):
-            if condition_code_pairs[i][0] == 'true':
-                resolve_fn += '\telse\n\t\t{0}\n'.format(
-                    condition_code_pairs[i][1])
-                break
-            else:
-                resolve_fn += '\telse if ({0})\n\t\t{1}\n'.format(
-                    *condition_code_pairs[i])
-
-    # Output code to return the dispatch function.
-    resolve_fn += '\treturn (piglit_dispatch_function_ptr) {0};\n'.format(
-        ds.dispatch_name)
-    resolve_fn += '}\n'
-    return resolve_fn
-
-
-# Generate the stub function for a given DispatchSet.
-def generate_stub_function(ds):
-    f0 = ds.primary_function
-
-    # Start the stub function
-    stub_fn = 'static {0}\n'.format(
-        f0.c_form('APIENTRY ' + ds.stub_name, anonymous_args=False))
-    stub_fn += '{\n'
-    stub_fn += '\tcheck_initialized();\n'
-    stub_fn += '\t{0}();\n'.format(ds.resolve_name)
-
-    # Output the call to the dispatch function.
-    stub_fn += '\t{0}{1}({2});\n'.format(
-        'return ' if f0.return_type != 'void' else '',
-        ds.dispatch_name, ', '.join(f0.param_names))
-    stub_fn += '}\n'
-    return stub_fn
-
-
-# Generate the reset_dispatch_pointers() function, which sets each
-# dispatch pointer to point to the corresponding stub function.
-def generate_dispatch_pointer_resetter(dispatch_sets):
-    result = []
-    result.append('static void\n')
-    result.append('reset_dispatch_pointers()\n')
-    result.append('{\n')
-    for ds in dispatch_sets:
-        result.append(
-            '\t{0} = {1};\n'.format(ds.dispatch_name, ds.stub_name))
-    result.append('}\n')
-    return ''.join(result)
-
-
-# Generate the function_names and function_resolvers tables.
-def generate_function_names_and_resolvers(dispatch_sets):
-    name_resolver_pairs = []
-    for ds in dispatch_sets:
-        for _, f in ds.cat_fn_pairs:
-            name_resolver_pairs.append((f.gl_name, ds.resolve_name))
-    name_resolver_pairs.sort()
-    result = []
-    result.append('static const char * const function_names[] = {\n')
-    for name, _ in name_resolver_pairs:
-        result.append('\t"{0}",\n'.format(name))
-    result.append('};\n')
-    result.append('\n')
-    result.append('static const piglit_dispatch_resolver_ptr '
-                  'function_resolvers[] = {\n')
-    for _, resolver in name_resolver_pairs:
-        result.append('\t{0},\n'.format(resolver))
-    result.append('};\n')
-    return ''.join(result)
-
-
-# Generate the C source and header files for the API.
-def generate_code(api):
-    c_contents = [generated_boilerplate()]
-    h_contents = [generated_boilerplate()]
-
-    unique_functions = api.compute_unique_functions()
-
-    # Emit typedefs for each name
-    for f in unique_functions:
-        h_contents.append(
-            'typedef {0};\n'.format(
-                f.c_form('(APIENTRY *{0})'.format(f.typedef_name),
-                         anonymous_args=True)))
-
-    dispatch_sets = api.compute_dispatch_sets()
-
-    for ds in dispatch_sets:
-        f0 = ds.primary_function
-
-        # Emit comment block
-        comments = '\n'
-        for cat, f in ds.cat_fn_pairs:
-            comments += '/* {0} ({1}) */\n'.format(f.gl_name, cat)
-        c_contents.append(comments)
-        h_contents.append(comments)
-
-        # Emit extern declaration of dispatch pointer
-        h_contents.append(
-            'extern {0} {1};\n'.format(f0.typedef_name, ds.dispatch_name))
-
-        # Emit defines aliasing each GL function to the dispatch
-        # pointer
-        for _, f in ds.cat_fn_pairs:
-            h_contents.append(
-                '#define {0} {1}\n'.format(f.gl_name, ds.dispatch_name))
-
-        # Emit resolve function
-        c_contents.append(generate_resolve_function(ds))
-
-        # Emit stub function
-        c_contents.append(generate_stub_function(ds))
-
-        # Emit initializer for dispatch pointer
-        c_contents.append(
-            '{0} {1} = {2};\n'.format(
-                f0.typedef_name, ds.dispatch_name, ds.stub_name))
-
-    # Emit dispatch pointer initialization function
-    c_contents.append(generate_dispatch_pointer_resetter(dispatch_sets))
-
-    c_contents.append('\n')
-
-    # Emit function_names and function_resolvers tables.
-    c_contents.append(generate_function_names_and_resolvers(dispatch_sets))
-
-    # Emit enum #defines
-    for name, value in api.compute_unique_enums():
-        h_contents.append('#define GL_{0} {1}\n'.format(name, value))
-
-    # Emit extension #defines
-    #
-    # While enum.ext lists some old extension names (defined to 1), it
-    # doesn't contain the full set that appears in glext.h.
-    h_contents.append('\n')
-    for ext in api.extensions:
-        h_contents.append('#define {0} 1\n'.format(ext))
-
-    # Emit GL version #defines
-    #
-    # While enum.ext lists GL versions up to 3.2, it didn't continue
-    # adding them for later GL versions.
-    h_contents.append('\n')
-    for ver in api.gl_versions:
-        h_contents.append('#define GL_VERSION_{0}_{1} 1\n'.format(
-            ver // 10, ver % 10))
-
-    return ''.join(c_contents), ''.join(h_contents)
-
-
-if __name__ == '__main__':
-    file_to_parse = sys.argv[1]
-    api = read_api(file_to_parse)
-
-    c_contents, h_contents = generate_code(api)
-    with open(sys.argv[2], 'w') as f:
-        f.write(c_contents)
-    with open(sys.argv[3], 'w') as f:
-        f.write(h_contents)
diff --git a/tests/util/glxew.h b/tests/util/glxew.h
deleted file mode 100644
index 2e855c1..0000000
--- a/tests/util/glxew.h
+++ /dev/null
@@ -1,1586 +0,0 @@
-/*
-** The OpenGL Extension Wrangler Library
-** Copyright (C) 2002-2008, Milan Ikits <milan ikits[]ieee org>
-** Copyright (C) 2002-2008, Marcelo E. Magallon <mmagallo[]debian org>
-** Copyright (C) 2002, Lev Povalahev
-** All rights reserved.
-** 
-** Redistribution and use in source and binary forms, with or without 
-** modification, are permitted provided that the following conditions are met:
-** 
-** * Redistributions of source code must retain the above copyright notice, 
-**   this list of conditions and the following disclaimer.
-** * Redistributions in binary form must reproduce the above copyright notice, 
-**   this list of conditions and the following disclaimer in the documentation 
-**   and/or other materials provided with the distribution.
-** * The name of the author may be used to endorse or promote products 
-**   derived from this software without specific prior written permission.
-**
-** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 
-** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
-** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-** ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
-** LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
-** CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
-** SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
-** INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
-** CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
-** ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
-** THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-/*
- * Mesa 3-D graphics library
- * Version:  7.0
- *
- * Copyright (C) 1999-2007  Brian Paul   All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-/*
-** Copyright (c) 2007 The Khronos Group Inc.
-** 
-** Permission is hereby granted, free of charge, to any person obtaining a
-** copy of this software and/or associated documentation files (the
-** "Materials"), to deal in the Materials without restriction, including
-** without limitation the rights to use, copy, modify, merge, publish,
-** distribute, sublicense, and/or sell copies of the Materials, and to
-** permit persons to whom the Materials are furnished to do so, subject to
-** the following conditions:
-** 
-** The above copyright notice and this permission notice shall be included
-** in all copies or substantial portions of the Materials.
-** 
-** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
-*/
-
-#ifndef __glxew_h__
-#define __glxew_h__
-#define __GLXEW_H__
-
-#ifdef __glxext_h_
-#error glxext.h included before glxew.h
-#endif
-
-#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__)
-#error glx.h included before glxew.h
-#endif
-
-#define __glxext_h_
-
-#define GLX_H
-#define __GLX_glx_h__
-#define __glx_h__
-
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#include <X11/Xmd.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* ---------------------------- GLX_VERSION_1_0 --------------------------- */
-
-#ifndef GLX_VERSION_1_0
-#define GLX_VERSION_1_0 1
-
-#define GLX_USE_GL 1
-#define GLX_BUFFER_SIZE 2
-#define GLX_LEVEL 3
-#define GLX_RGBA 4
-#define GLX_DOUBLEBUFFER 5
-#define GLX_STEREO 6
-#define GLX_AUX_BUFFERS 7
-#define GLX_RED_SIZE 8
-#define GLX_GREEN_SIZE 9
-#define GLX_BLUE_SIZE 10
-#define GLX_ALPHA_SIZE 11
-#define GLX_DEPTH_SIZE 12
-#define GLX_STENCIL_SIZE 13
-#define GLX_ACCUM_RED_SIZE 14
-#define GLX_ACCUM_GREEN_SIZE 15
-#define GLX_ACCUM_BLUE_SIZE 16
-#define GLX_ACCUM_ALPHA_SIZE 17
-#define GLX_BAD_SCREEN 1
-#define GLX_BAD_ATTRIBUTE 2
-#define GLX_NO_EXTENSION 3
-#define GLX_BAD_VISUAL 4
-#define GLX_BAD_CONTEXT 5
-#define GLX_BAD_VALUE 6
-#define GLX_BAD_ENUM 7
-
-typedef XID GLXDrawable;
-typedef XID GLXPixmap;
-#ifdef __sun
-typedef struct __glXContextRec *GLXContext;
-#else
-typedef struct __GLXcontextRec *GLXContext;
-#endif
-
-typedef unsigned int GLXVideoDeviceNV; 
-
-extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase);
-extern Bool glXQueryVersion (Display *dpy, int *major, int *minor);
-extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value);
-extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList);
-extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap);
-extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix);
-extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct);
-extern void glXDestroyContext (Display *dpy, GLXContext ctx);
-extern Bool glXIsDirect (Display *dpy, GLXContext ctx);
-extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask);
-extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx);
-extern GLXContext glXGetCurrentContext (void);
-extern GLXDrawable glXGetCurrentDrawable (void);
-extern void glXWaitGL (void);
-extern void glXWaitX (void);
-extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable);
-extern void glXUseXFont (Font font, int first, int count, int listBase);
-
-#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0)
-
-#endif /* GLX_VERSION_1_0 */
-
-/* ---------------------------- GLX_VERSION_1_1 --------------------------- */
-
-#ifndef GLX_VERSION_1_1
-#define GLX_VERSION_1_1
-
-#define GLX_VENDOR 0x1
-#define GLX_VERSION 0x2
-#define GLX_EXTENSIONS 0x3
-
-extern const char* glXQueryExtensionsString (Display *dpy, int screen);
-extern const char* glXGetClientString (Display *dpy, int name);
-extern const char* glXQueryServerString (Display *dpy, int screen, int name);
-
-#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1)
-
-#endif /* GLX_VERSION_1_1 */
-
-/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */
-
-#ifndef GLX_VERSION_1_2
-#define GLX_VERSION_1_2 1
-
-typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void);
-
-#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay)
-
-#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2)
-
-#endif /* GLX_VERSION_1_2 */
-
-/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */
-
-#ifndef GLX_VERSION_1_3
-#define GLX_VERSION_1_3 1
-
-#define GLX_RGBA_BIT 0x00000001
-#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
-#define GLX_WINDOW_BIT 0x00000001
-#define GLX_COLOR_INDEX_BIT 0x00000002
-#define GLX_PIXMAP_BIT 0x00000002
-#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
-#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
-#define GLX_PBUFFER_BIT 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
-#define GLX_AUX_BUFFERS_BIT 0x00000010
-#define GLX_CONFIG_CAVEAT 0x20
-#define GLX_DEPTH_BUFFER_BIT 0x00000020
-#define GLX_X_VISUAL_TYPE 0x22
-#define GLX_TRANSPARENT_TYPE 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE 0x24
-#define GLX_TRANSPARENT_RED_VALUE 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
-#define GLX_STENCIL_BUFFER_BIT 0x00000040
-#define GLX_ACCUM_BUFFER_BIT 0x00000080
-#define GLX_NONE 0x8000
-#define GLX_SLOW_CONFIG 0x8001
-#define GLX_TRUE_COLOR 0x8002
-#define GLX_DIRECT_COLOR 0x8003
-#define GLX_PSEUDO_COLOR 0x8004
-#define GLX_STATIC_COLOR 0x8005
-#define GLX_GRAY_SCALE 0x8006
-#define GLX_STATIC_GRAY 0x8007
-#define GLX_TRANSPARENT_RGB 0x8008
-#define GLX_TRANSPARENT_INDEX 0x8009
-#define GLX_VISUAL_ID 0x800B
-#define GLX_SCREEN 0x800C
-#define GLX_NON_CONFORMANT_CONFIG 0x800D
-#define GLX_DRAWABLE_TYPE 0x8010
-#define GLX_RENDER_TYPE 0x8011
-#define GLX_X_RENDERABLE 0x8012
-#define GLX_FBCONFIG_ID 0x8013
-#define GLX_RGBA_TYPE 0x8014
-#define GLX_COLOR_INDEX_TYPE 0x8015
-#define GLX_MAX_PBUFFER_WIDTH 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT 0x8017
-#define GLX_MAX_PBUFFER_PIXELS 0x8018
-#define GLX_PRESERVED_CONTENTS 0x801B
-#define GLX_LARGEST_PBUFFER 0x801C
-#define GLX_WIDTH 0x801D
-#define GLX_HEIGHT 0x801E
-#define GLX_EVENT_MASK 0x801F
-#define GLX_DAMAGED 0x8020
-#define GLX_SAVED 0x8021
-#define GLX_WINDOW 0x8022
-#define GLX_PBUFFER 0x8023
-#define GLX_PBUFFER_HEIGHT 0x8040
-#define GLX_PBUFFER_WIDTH 0x8041
-#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
-#define GLX_DONT_CARE 0xFFFFFFFF
-
-typedef XID GLXFBConfigID;
-typedef XID GLXPbuffer;
-typedef XID GLXWindow;
-typedef struct __GLXFBConfigRec *GLXFBConfig;
-
-typedef struct {
-  int event_type; 
-  int draw_type; 
-  unsigned long serial; 
-  Bool send_event; 
-  Display *display; 
-  GLXDrawable drawable; 
-  unsigned int buffer_mask; 
-  unsigned int aux_buffer; 
-  int x, y; 
-  int width, height; 
-  int count; 
-} GLXPbufferClobberEvent;
-typedef union __GLXEvent {
-  GLXPbufferClobberEvent glxpbufferclobber; 
-  long pad[24]; 
-} GLXEvent;
-
-typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
-typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
-typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
-typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
-typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
-typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
-typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
-typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
-typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
-
-#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig)
-#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext)
-#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer)
-#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap)
-#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow)
-#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer)
-#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap)
-#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow)
-#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable)
-#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib)
-#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs)
-#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent)
-#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig)
-#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent)
-#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext)
-#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable)
-#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent)
-
-#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3)
-
-#endif /* GLX_VERSION_1_3 */
-
-/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */
-
-#ifndef GLX_VERSION_1_4
-#define GLX_VERSION_1_4 1
-
-#define GLX_SAMPLE_BUFFERS 100000
-#define GLX_SAMPLES 100001
-
-extern void ( * glXGetProcAddress (const GLubyte *procName)) (void);
-
-#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4)
-
-#endif /* GLX_VERSION_1_4 */
-
-/* -------------------------- GLX_3DFX_multisample ------------------------- */
-
-#ifndef GLX_3DFX_multisample
-#define GLX_3DFX_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
-#define GLX_SAMPLES_3DFX 0x8051
-
-#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample)
-
-#endif /* GLX_3DFX_multisample */
-
-/* ------------------------ GLX_AMD_gpu_association ------------------------ */
-
-#ifndef GLX_AMD_gpu_association
-#define GLX_AMD_gpu_association 1
-
-#define GLX_GPU_VENDOR_AMD 0x1F00
-#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
-#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
-#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
-#define GLX_GPU_RAM_AMD 0x21A3
-#define GLX_GPU_CLOCK_AMD 0x21A4
-#define GLX_GPU_NUM_PIPES_AMD 0x21A5
-#define GLX_GPU_NUM_SIMD_AMD 0x21A6
-#define GLX_GPU_NUM_RB_AMD 0x21A7
-#define GLX_GPU_NUM_SPI_AMD 0x21A8
-
-#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association)
-
-#endif /* GLX_AMD_gpu_association */
-
-/* ------------------------- GLX_ARB_create_context ------------------------ */
-
-#ifndef GLX_ARB_create_context
-#define GLX_ARB_create_context 1
-
-#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001
-#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
-#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
-#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
-#define GLX_CONTEXT_FLAGS_ARB 0x2094
-
-typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
-
-#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB)
-
-#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context)
-
-#endif /* GLX_ARB_create_context */
-
-/* --------------------- GLX_ARB_create_context_profile -------------------- */
-
-#ifndef GLX_ARB_create_context_profile
-#define GLX_ARB_create_context_profile 1
-
-#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
-#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
-#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
-
-#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile)
-
-#endif /* GLX_ARB_create_context_profile */
-
-/* ------------------- GLX_ARB_create_context_robustness ------------------- */
-
-#ifndef GLX_ARB_create_context_robustness
-#define GLX_ARB_create_context_robustness 1
-
-#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
-#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
-#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
-#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
-
-#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness)
-
-#endif /* GLX_ARB_create_context_robustness */
-
-/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */
-
-#ifndef GLX_ARB_fbconfig_float
-#define GLX_ARB_fbconfig_float 1
-
-#define GLX_RGBA_FLOAT_BIT 0x00000004
-#define GLX_RGBA_FLOAT_TYPE 0x20B9
-
-#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float)
-
-#endif /* GLX_ARB_fbconfig_float */
-
-/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_ARB_framebuffer_sRGB
-#define GLX_ARB_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
-
-#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB)
-
-#endif /* GLX_ARB_framebuffer_sRGB */
-
-/* ------------------------ GLX_ARB_get_proc_address ----------------------- */
-
-#ifndef GLX_ARB_get_proc_address
-#define GLX_ARB_get_proc_address 1
-
-extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void);
-
-#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address)
-
-#endif /* GLX_ARB_get_proc_address */
-
-/* -------------------------- GLX_ARB_multisample -------------------------- */
-
-#ifndef GLX_ARB_multisample
-#define GLX_ARB_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_ARB 100000
-#define GLX_SAMPLES_ARB 100001
-
-#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample)
-
-#endif /* GLX_ARB_multisample */
-
-/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */
-
-#ifndef GLX_ARB_vertex_buffer_object
-#define GLX_ARB_vertex_buffer_object 1
-
-#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
-
-#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object)
-
-#endif /* GLX_ARB_vertex_buffer_object */
-
-/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */
-
-#ifndef GLX_ATI_pixel_format_float
-#define GLX_ATI_pixel_format_float 1
-
-#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100
-
-#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float)
-
-#endif /* GLX_ATI_pixel_format_float */
-
-/* ------------------------- GLX_ATI_render_texture ------------------------ */
-
-#ifndef GLX_ATI_render_texture
-#define GLX_ATI_render_texture 1
-
-#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800
-#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801
-#define GLX_TEXTURE_FORMAT_ATI 0x9802
-#define GLX_TEXTURE_TARGET_ATI 0x9803
-#define GLX_MIPMAP_TEXTURE_ATI 0x9804
-#define GLX_TEXTURE_RGB_ATI 0x9805
-#define GLX_TEXTURE_RGBA_ATI 0x9806
-#define GLX_NO_TEXTURE_ATI 0x9807
-#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808
-#define GLX_TEXTURE_1D_ATI 0x9809
-#define GLX_TEXTURE_2D_ATI 0x980A
-#define GLX_MIPMAP_LEVEL_ATI 0x980B
-#define GLX_CUBE_MAP_FACE_ATI 0x980C
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810
-#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811
-#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812
-#define GLX_FRONT_LEFT_ATI 0x9813
-#define GLX_FRONT_RIGHT_ATI 0x9814
-#define GLX_BACK_LEFT_ATI 0x9815
-#define GLX_BACK_RIGHT_ATI 0x9816
-#define GLX_AUX0_ATI 0x9817
-#define GLX_AUX1_ATI 0x9818
-#define GLX_AUX2_ATI 0x9819
-#define GLX_AUX3_ATI 0x981A
-#define GLX_AUX4_ATI 0x981B
-#define GLX_AUX5_ATI 0x981C
-#define GLX_AUX6_ATI 0x981D
-#define GLX_AUX7_ATI 0x981E
-#define GLX_AUX8_ATI 0x981F
-#define GLX_AUX9_ATI 0x9820
-#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821
-#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822
-
-typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer);
-
-#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI)
-#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI)
-#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI)
-
-#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture)
-
-#endif /* GLX_ATI_render_texture */
-
-/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */
-
-#ifndef GLX_EXT_create_context_es2_profile
-#define GLX_EXT_create_context_es2_profile 1
-
-#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
-
-#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile)
-
-#endif /* GLX_EXT_create_context_es2_profile */
-
-/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */
-
-#ifndef GLX_EXT_fbconfig_packed_float
-#define GLX_EXT_fbconfig_packed_float 1
-
-#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
-#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
-
-#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float)
-
-#endif /* GLX_EXT_fbconfig_packed_float */
-
-/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */
-
-#ifndef GLX_EXT_framebuffer_sRGB
-#define GLX_EXT_framebuffer_sRGB 1
-
-#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
-
-#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB)
-
-#endif /* GLX_EXT_framebuffer_sRGB */
-
-/* ------------------------- GLX_EXT_import_context ------------------------ */
-
-#ifndef GLX_EXT_import_context
-#define GLX_EXT_import_context 1
-
-#define GLX_SHARE_CONTEXT_EXT 0x800A
-#define GLX_VISUAL_ID_EXT 0x800B
-#define GLX_SCREEN_EXT 0x800C
-
-typedef XID GLXContextID;
-
-typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context);
-typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
-typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID);
-typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value);
-
-#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT)
-#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT)
-#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT)
-#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT)
-
-#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context)
-
-#endif /* GLX_EXT_import_context */
-
-/* -------------------------- GLX_EXT_scene_marker ------------------------- */
-
-#ifndef GLX_EXT_scene_marker
-#define GLX_EXT_scene_marker 1
-
-#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker)
-
-#endif /* GLX_EXT_scene_marker */
-
-/* -------------------------- GLX_EXT_swap_control ------------------------- */
-
-#ifndef GLX_EXT_swap_control
-#define GLX_EXT_swap_control 1
-
-#define GLX_SWAP_INTERVAL_EXT 0x20F1
-#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
-
-typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval);
-
-#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT)
-
-#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control)
-
-#endif /* GLX_EXT_swap_control */
-
-/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */
-
-#ifndef GLX_EXT_texture_from_pixmap
-#define GLX_EXT_texture_from_pixmap 1
-
-#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
-#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
-#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
-#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
-#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
-#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
-#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
-#define GLX_Y_INVERTED_EXT 0x20D4
-#define GLX_TEXTURE_FORMAT_EXT 0x20D5
-#define GLX_TEXTURE_TARGET_EXT 0x20D6
-#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
-#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
-#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
-#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
-#define GLX_TEXTURE_1D_EXT 0x20DB
-#define GLX_TEXTURE_2D_EXT 0x20DC
-#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
-#define GLX_FRONT_LEFT_EXT 0x20DE
-#define GLX_FRONT_RIGHT_EXT 0x20DF
-#define GLX_BACK_LEFT_EXT 0x20E0
-#define GLX_BACK_RIGHT_EXT 0x20E1
-#define GLX_AUX0_EXT 0x20E2
-#define GLX_AUX1_EXT 0x20E3
-#define GLX_AUX2_EXT 0x20E4
-#define GLX_AUX3_EXT 0x20E5
-#define GLX_AUX4_EXT 0x20E6
-#define GLX_AUX5_EXT 0x20E7
-#define GLX_AUX6_EXT 0x20E8
-#define GLX_AUX7_EXT 0x20E9
-#define GLX_AUX8_EXT 0x20EA
-#define GLX_AUX9_EXT 0x20EB
-
-typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list);
-typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer);
-
-#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT)
-#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT)
-
-#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap)
-
-#endif /* GLX_EXT_texture_from_pixmap */
-
-/* -------------------------- GLX_EXT_visual_info -------------------------- */
-
-#ifndef GLX_EXT_visual_info
-#define GLX_EXT_visual_info 1
-
-#define GLX_X_VISUAL_TYPE_EXT 0x22
-#define GLX_TRANSPARENT_TYPE_EXT 0x23
-#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
-#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
-#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
-#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
-#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
-#define GLX_NONE_EXT 0x8000
-#define GLX_TRUE_COLOR_EXT 0x8002
-#define GLX_DIRECT_COLOR_EXT 0x8003
-#define GLX_PSEUDO_COLOR_EXT 0x8004
-#define GLX_STATIC_COLOR_EXT 0x8005
-#define GLX_GRAY_SCALE_EXT 0x8006
-#define GLX_STATIC_GRAY_EXT 0x8007
-#define GLX_TRANSPARENT_RGB_EXT 0x8008
-#define GLX_TRANSPARENT_INDEX_EXT 0x8009
-
-#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info)
-
-#endif /* GLX_EXT_visual_info */
-
-/* ------------------------- GLX_EXT_visual_rating ------------------------- */
-
-#ifndef GLX_EXT_visual_rating
-#define GLX_EXT_visual_rating 1
-
-#define GLX_VISUAL_CAVEAT_EXT 0x20
-#define GLX_SLOW_VISUAL_EXT 0x8001
-#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
-
-#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating)
-
-#endif /* GLX_EXT_visual_rating */
-
-/* -------------------------- GLX_INTEL_swap_event ------------------------- */
-
-#ifndef GLX_INTEL_swap_event
-#define GLX_INTEL_swap_event 1
-
-#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
-#define GLX_COPY_COMPLETE_INTEL 0x8181
-#define GLX_FLIP_COMPLETE_INTEL 0x8182
-#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
-
-#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event)
-
-#endif /* GLX_INTEL_swap_event */
-
-/* -------------------------- GLX_MESA_agp_offset -------------------------- */
-
-#ifndef GLX_MESA_agp_offset
-#define GLX_MESA_agp_offset 1
-
-typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer);
-
-#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA)
-
-#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset)
-
-#endif /* GLX_MESA_agp_offset */
-
-/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */
-
-#ifndef GLX_MESA_copy_sub_buffer
-#define GLX_MESA_copy_sub_buffer 1
-
-typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height);
-
-#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA)
-
-#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer)
-
-#endif /* GLX_MESA_copy_sub_buffer */
-
-/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */
-
-#ifndef GLX_MESA_pixmap_colormap
-#define GLX_MESA_pixmap_colormap 1
-
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
-
-#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA)
-
-#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap)
-
-#endif /* GLX_MESA_pixmap_colormap */
-
-/* ------------------------ GLX_MESA_release_buffers ----------------------- */
-
-#ifndef GLX_MESA_release_buffers
-#define GLX_MESA_release_buffers 1
-
-typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d);
-
-#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA)
-
-#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers)
-
-#endif /* GLX_MESA_release_buffers */
-
-/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */
-
-#ifndef GLX_MESA_set_3dfx_mode
-#define GLX_MESA_set_3dfx_mode 1
-
-#define GLX_3DFX_WINDOW_MODE_MESA 0x1
-#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
-
-typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
-
-#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA)
-
-#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode)
-
-#endif /* GLX_MESA_set_3dfx_mode */
-
-/* ------------------------- GLX_MESA_swap_control ------------------------- */
-
-#ifndef GLX_MESA_swap_control
-#define GLX_MESA_swap_control 1
-
-typedef int ( * PFNGLXGETSWAPINTERVALMESAPROC) (void);
-typedef int ( * PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
-
-#define glXGetSwapIntervalMESA GLXEW_GET_FUN(__glewXGetSwapIntervalMESA)
-#define glXSwapIntervalMESA GLXEW_GET_FUN(__glewXSwapIntervalMESA)
-
-#define GLXEW_MESA_swap_control GLXEW_GET_VAR(__GLXEW_MESA_swap_control)
-
-#endif /* GLX_MESA_swap_control */
-
-/* --------------------------- GLX_NV_copy_image --------------------------- */
-
-#ifndef GLX_NV_copy_image
-#define GLX_NV_copy_image 1
-
-typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
-
-#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV)
-
-#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image)
-
-#endif /* GLX_NV_copy_image */
-
-/* -------------------------- GLX_NV_float_buffer -------------------------- */
-
-#ifndef GLX_NV_float_buffer
-#define GLX_NV_float_buffer 1
-
-#define GLX_FLOAT_COMPONENTS_NV 0x20B0
-
-#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer)
-
-#endif /* GLX_NV_float_buffer */
-
-/* ---------------------- GLX_NV_multisample_coverage ---------------------- */
-
-#ifndef GLX_NV_multisample_coverage
-#define GLX_NV_multisample_coverage 1
-
-#define GLX_COLOR_SAMPLES_NV 0x20B3
-#define GLX_COVERAGE_SAMPLES_NV 100001
-
-#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage)
-
-#endif /* GLX_NV_multisample_coverage */
-
-/* -------------------------- GLX_NV_present_video ------------------------- */
-
-#ifndef GLX_NV_present_video
-#define GLX_NV_present_video 1
-
-#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
-
-typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
-typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
-
-#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV)
-#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV)
-
-#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video)
-
-#endif /* GLX_NV_present_video */
-
-/* --------------------------- GLX_NV_swap_group --------------------------- */
-
-#ifndef GLX_NV_swap_group
-#define GLX_NV_swap_group 1
-
-typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier);
-typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group);
-typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count);
-typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
-typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
-typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen);
-
-#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV)
-#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV)
-#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV)
-#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV)
-#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV)
-#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV)
-
-#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group)
-
-#endif /* GLX_NV_swap_group */
-
-/* ----------------------- GLX_NV_vertex_array_range ----------------------- */
-
-#ifndef GLX_NV_vertex_array_range
-#define GLX_NV_vertex_array_range 1
-
-typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority);
-typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer);
-
-#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV)
-#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV)
-
-#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range)
-
-#endif /* GLX_NV_vertex_array_range */
-
-/* -------------------------- GLX_NV_video_capture ------------------------- */
-
-#ifndef GLX_NV_video_capture
-#define GLX_NV_video_capture 1
-
-#define GLX_DEVICE_ID_NV 0x20CD
-#define GLX_UNIQUE_ID_NV 0x20CE
-#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
-
-typedef XID GLXVideoCaptureDeviceNV;
-
-typedef int ( * PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display* dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
-typedef GLXVideoCaptureDeviceNV * ( * PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display* dpy, int screen, int *nelements);
-typedef void ( * PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-typedef int ( * PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
-typedef void ( * PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display* dpy, GLXVideoCaptureDeviceNV device);
-
-#define glXBindVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXBindVideoCaptureDeviceNV)
-#define glXEnumerateVideoCaptureDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoCaptureDevicesNV)
-#define glXLockVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXLockVideoCaptureDeviceNV)
-#define glXQueryVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXQueryVideoCaptureDeviceNV)
-#define glXReleaseVideoCaptureDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoCaptureDeviceNV)
-
-#define GLXEW_NV_video_capture GLXEW_GET_VAR(__GLXEW_NV_video_capture)
-
-#endif /* GLX_NV_video_capture */
-
-/* -------------------------- GLX_NV_video_output -------------------------- */
-
-#ifndef GLX_NV_video_output
-#define GLX_NV_video_output 1
-
-#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
-#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
-#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
-#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
-#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
-#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
-#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
-#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
-#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
-#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
-
-typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
-typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
-typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
-typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice);
-typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
-
-#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV)
-#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV)
-#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV)
-#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV)
-#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV)
-#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV)
-
-#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output)
-
-#endif /* GLX_NV_video_output */
-
-/* -------------------------- GLX_OML_swap_method -------------------------- */
-
-#ifndef GLX_OML_swap_method
-#define GLX_OML_swap_method 1
-
-#define GLX_SWAP_METHOD_OML 0x8060
-#define GLX_SWAP_EXCHANGE_OML 0x8061
-#define GLX_SWAP_COPY_OML 0x8062
-#define GLX_SWAP_UNDEFINED_OML 0x8063
-
-#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method)
-
-#endif /* GLX_OML_swap_method */
-
-/* -------------------------- GLX_OML_sync_control ------------------------- */
-
-#ifndef GLX_OML_sync_control
-#define GLX_OML_sync_control 1
-
-typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator);
-typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
-typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc);
-typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc);
-
-#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML)
-#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML)
-#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML)
-#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML)
-#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML)
-
-#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control)
-
-#endif /* GLX_OML_sync_control */
-
-/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */
-
-#ifndef GLX_SGIS_blended_overlay
-#define GLX_SGIS_blended_overlay 1
-
-#define GLX_BLENDED_RGBA_SGIS 0x8025
-
-#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay)
-
-#endif /* GLX_SGIS_blended_overlay */
-
-/* -------------------------- GLX_SGIS_color_range ------------------------- */
-
-#ifndef GLX_SGIS_color_range
-#define GLX_SGIS_color_range 1
-
-#define GLX_MIN_RED_SGIS 0
-#define GLX_MAX_GREEN_SGIS 0
-#define GLX_MIN_BLUE_SGIS 0
-#define GLX_MAX_ALPHA_SGIS 0
-#define GLX_MIN_GREEN_SGIS 0
-#define GLX_MIN_ALPHA_SGIS 0
-#define GLX_MAX_RED_SGIS 0
-#define GLX_EXTENDED_RANGE_SGIS 0
-#define GLX_MAX_BLUE_SGIS 0
-
-#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range)
-
-#endif /* GLX_SGIS_color_range */
-
-/* -------------------------- GLX_SGIS_multisample ------------------------- */
-
-#ifndef GLX_SGIS_multisample
-#define GLX_SGIS_multisample 1
-
-#define GLX_SAMPLE_BUFFERS_SGIS 100000
-#define GLX_SAMPLES_SGIS 100001
-
-#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample)
-
-#endif /* GLX_SGIS_multisample */
-
-/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */
-
-#ifndef GLX_SGIS_shared_multisample
-#define GLX_SGIS_shared_multisample 1
-
-#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
-#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
-
-#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample)
-
-#endif /* GLX_SGIS_shared_multisample */
-
-/* --------------------------- GLX_SGIX_fbconfig --------------------------- */
-
-#ifndef GLX_SGIX_fbconfig
-#define GLX_SGIX_fbconfig 1
-
-#define GLX_WINDOW_BIT_SGIX 0x00000001
-#define GLX_RGBA_BIT_SGIX 0x00000001
-#define GLX_PIXMAP_BIT_SGIX 0x00000002
-#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
-#define GLX_SCREEN_EXT 0x800C
-#define GLX_DRAWABLE_TYPE_SGIX 0x8010
-#define GLX_RENDER_TYPE_SGIX 0x8011
-#define GLX_X_RENDERABLE_SGIX 0x8012
-#define GLX_FBCONFIG_ID_SGIX 0x8013
-#define GLX_RGBA_TYPE_SGIX 0x8014
-#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
-
-typedef XID GLXFBConfigIDSGIX;
-typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
-
-typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
-typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
-typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap);
-typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value);
-typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis);
-typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config);
-
-#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX)
-#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX)
-#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX)
-#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX)
-#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX)
-#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX)
-
-#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig)
-
-#endif /* GLX_SGIX_fbconfig */
-
-/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */
-
-#ifndef GLX_SGIX_hyperpipe
-#define GLX_SGIX_hyperpipe 1
-
-#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
-#define GLX_PIPE_RECT_SGIX 0x00000001
-#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
-#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
-#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
-#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
-#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
-#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
-#define GLX_BAD_HYPERPIPE_SGIX 92
-#define GLX_HYPERPIPE_ID_SGIX 0x8030
-
-typedef struct {
-  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
-  int  networkId; 
-} GLXHyperpipeNetworkSGIX;
-typedef struct {
-  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
-  int XOrigin; 
-  int YOrigin; 
-  int maxHeight; 
-  int maxWidth; 
-} GLXPipeRectLimits;
-typedef struct {
-  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
-  int channel; 
-  unsigned int participationType; 
-  int timeSlice; 
-} GLXHyperpipeConfigSGIX;
-typedef struct {
-  char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; 
-  int srcXOrigin; 
-  int srcYOrigin; 
-  int srcWidth; 
-  int srcHeight; 
-  int destXOrigin; 
-  int destYOrigin; 
-  int destWidth; 
-  int destHeight; 
-} GLXPipeRect;
-
-typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
-typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
-typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
-typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
-typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
-typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
-typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
-
-#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX)
-#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX)
-#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX)
-#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX)
-#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX)
-#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX)
-#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX)
-#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX)
-
-#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe)
-
-#endif /* GLX_SGIX_hyperpipe */
-
-/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */
-
-#ifndef GLX_SGIX_pbuffer
-#define GLX_SGIX_pbuffer 1
-
-#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
-#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
-#define GLX_PBUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
-#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
-#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
-#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
-#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
-#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
-#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
-#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
-#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
-#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
-#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
-#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
-#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
-#define GLX_LARGEST_PBUFFER_SGIX 0x801C
-#define GLX_WIDTH_SGIX 0x801D
-#define GLX_HEIGHT_SGIX 0x801E
-#define GLX_EVENT_MASK_SGIX 0x801F
-#define GLX_DAMAGED_SGIX 0x8020
-#define GLX_SAVED_SGIX 0x8021
-#define GLX_WINDOW_SGIX 0x8022
-#define GLX_PBUFFER_SGIX 0x8023
-#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
-
-typedef XID GLXPbufferSGIX;
-typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX;
-
-typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list);
-typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf);
-typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask);
-typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value);
-typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask);
-
-#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX)
-#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX)
-#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX)
-#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX)
-#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX)
-
-#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer)
-
-#endif /* GLX_SGIX_pbuffer */
-
-/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */
-
-#ifndef GLX_SGIX_swap_barrier
-#define GLX_SGIX_swap_barrier 1
-
-typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
-typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
-
-#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX)
-#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX)
-
-#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier)
-
-#endif /* GLX_SGIX_swap_barrier */
-
-/* -------------------------- GLX_SGIX_swap_group -------------------------- */
-
-#ifndef GLX_SGIX_swap_group
-#define GLX_SGIX_swap_group 1
-
-typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
-
-#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX)
-
-#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group)
-
-#endif /* GLX_SGIX_swap_group */
-
-/* ------------------------- GLX_SGIX_video_resize ------------------------- */
-
-#ifndef GLX_SGIX_video_resize
-#define GLX_SGIX_video_resize 1
-
-#define GLX_SYNC_FRAME_SGIX 0x00000000
-#define GLX_SYNC_SWAP_SGIX 0x00000001
-
-typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window);
-typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h);
-typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype);
-typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h);
-typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
-
-#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX)
-#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX)
-#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX)
-#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX)
-#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX)
-
-#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize)
-
-#endif /* GLX_SGIX_video_resize */
-
-/* ---------------------- GLX_SGIX_visual_select_group --------------------- */
-
-#ifndef GLX_SGIX_visual_select_group
-#define GLX_SGIX_visual_select_group 1
-
-#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
-
-#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group)
-
-#endif /* GLX_SGIX_visual_select_group */
-
-/* ---------------------------- GLX_SGI_cushion ---------------------------- */
-
-#ifndef GLX_SGI_cushion
-#define GLX_SGI_cushion 1
-
-typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion);
-
-#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI)
-
-#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion)
-
-#endif /* GLX_SGI_cushion */
-
-/* ----------------------- GLX_SGI_make_current_read ----------------------- */
-
-#ifndef GLX_SGI_make_current_read
-#define GLX_SGI_make_current_read 1
-
-typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
-typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
-
-#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI)
-#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI)
-
-#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read)
-
-#endif /* GLX_SGI_make_current_read */
-
-/* -------------------------- GLX_SGI_swap_control ------------------------- */
-
-#ifndef GLX_SGI_swap_control
-#define GLX_SGI_swap_control 1
-
-typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval);
-
-#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI)
-
-#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control)
-
-#endif /* GLX_SGI_swap_control */
-
-/* --------------------------- GLX_SGI_video_sync -------------------------- */
-
-#ifndef GLX_SGI_video_sync
-#define GLX_SGI_video_sync 1
-
-typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count);
-typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count);
-
-#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI)
-#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI)
-
-#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync)
-
-#endif /* GLX_SGI_video_sync */
-
-/* --------------------- GLX_SUN_get_transparent_index --------------------- */
-
-#ifndef GLX_SUN_get_transparent_index
-#define GLX_SUN_get_transparent_index 1
-
-typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);
-
-#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN)
-
-#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index)
-
-#endif /* GLX_SUN_get_transparent_index */
-
-/* -------------------------- GLX_SUN_video_resize ------------------------- */
-
-#ifndef GLX_SUN_video_resize
-#define GLX_SUN_video_resize 1
-
-#define GLX_VIDEO_RESIZE_SUN 0x8171
-#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD
-
-typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor);
-typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor);
-
-#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN)
-#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN)
-
-#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize)
-
-#endif /* GLX_SUN_video_resize */
-
-/* ------------------------------------------------------------------------- */
-
-#ifdef GLEW_MX
-#define GLXEW_EXPORT
-#else
-#define GLXEW_EXPORT extern
-#endif /* GLEW_MX */
-
-extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay;
-
-extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig;
-extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext;
-extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer;
-extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap;
-extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow;
-extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer;
-extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap;
-extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow;
-extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable;
-extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib;
-extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs;
-extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent;
-extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig;
-extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent;
-extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext;
-extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable;
-extern PFNGLXSELECTEVENTPROC __glewXSelectEvent;
-
-extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB;
-
-extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI;
-extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI;
-extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI;
-
-extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT;
-extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT;
-extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT;
-extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT;
-
-extern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT;
-
-extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT;
-extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT;
-
-extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA;
-
-extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA;
-
-extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA;
-
-extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA;
-
-extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA;
-
-extern PFNGLXGETSWAPINTERVALMESAPROC __glewXGetSwapIntervalMESA;
-extern PFNGLXSWAPINTERVALMESAPROC __glewXSwapIntervalMESA;
-
-extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV;
-
-extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV;
-extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV;
-
-extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV;
-extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV;
-extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV;
-extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV;
-extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV;
-extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV;
-
-extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV;
-extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV;
-
-extern PFNGLXBINDVIDEOCAPTUREDEVICENVPROC __glewXBindVideoCaptureDeviceNV;
-extern PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC __glewXEnumerateVideoCaptureDevicesNV;
-extern PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC __glewXLockVideoCaptureDeviceNV;
-extern PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC __glewXQueryVideoCaptureDeviceNV;
-extern PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC __glewXReleaseVideoCaptureDeviceNV;
-
-extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV;
-extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV;
-extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV;
-extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV;
-extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV;
-extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV;
-
-extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML;
-extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML;
-extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML;
-extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML;
-extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML;
-
-extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX;
-extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX;
-extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX;
-extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX;
-extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX;
-extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX;
-
-extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX;
-extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX;
-extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX;
-extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX;
-extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX;
-extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX;
-extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX;
-extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX;
-
-extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX;
-extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX;
-extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX;
-extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX;
-extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX;
-
-extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX;
-extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX;
-
-extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX;
-
-extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX;
-extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX;
-extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX;
-extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX;
-extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX;
-
-extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI;
-
-extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI;
-extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI;
-
-extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI;
-
-extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI;
-extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI;
-
-extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN;
-
-extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN;
-extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN;
-
-#if defined(GLEW_MX)
-struct GLXEWContextStruct
-{
-#endif /* GLEW_MX */
-
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3;
-GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4;
-GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_AMD_gpu_association;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_robustness;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object;
-GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float;
-GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info;
-GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating;
-GLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode;
-GLXEW_EXPORT GLboolean __GLXEW_MESA_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image;
-GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer;
-GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage;
-GLXEW_EXPORT GLboolean __GLXEW_NV_present_video;
-GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group;
-GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range;
-GLXEW_EXPORT GLboolean __GLXEW_NV_video_capture;
-GLXEW_EXPORT GLboolean __GLXEW_NV_video_output;
-GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method;
-GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize;
-GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control;
-GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync;
-GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index;
-GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize;
-
-#ifdef GLEW_MX
-}; /* GLXEWContextStruct */
-#endif /* GLEW_MX */
-
-/* ------------------------------------------------------------------------ */
-
-#ifdef GLEW_MX
-
-typedef struct GLXEWContextStruct GLXEWContext;
-extern GLenum glxewContextInit (GLXEWContext* ctx);
-extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name);
-
-#define glxewInit() glxewContextInit(glxewGetContext())
-#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x)
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x))
-#define GLXEW_GET_FUN(x) x
-
-#else /* GLEW_MX */
-
-#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x)
-#define GLXEW_GET_FUN(x) x
-
-extern GLboolean glxewIsSupported (const char* name);
-
-#endif /* GLEW_MX */
-
-extern GLboolean glxewGetExtension (const char* name);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __glxew_h__ */
diff --git a/tests/util/piglit-dispatch-init.c b/tests/util/piglit-dispatch-init.c
deleted file mode 100644
index 22318a3..0000000
--- a/tests/util/piglit-dispatch-init.c
+++ /dev/null
@@ -1,202 +0,0 @@
-/* Copyright 2012 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "piglit-util-gl-common.h"
-
-#if defined(_WIN32)
-
-#elif defined(__APPLE__)
-
-#include <stdlib.h>
-#include <string.h>
-#include <AvailabilityMacros.h>
-#include <dlfcn.h>
-
-#else /* Linux */
-
-#if defined(PIGLIT_HAS_GLX)
-#	include "glxew.h"
-#elif defined(PIGLIT_HAS_EGL)
-#	include <EGL/egl.h>
-#endif
-
-#endif
-
-/**
- * Generated code calls this function if the test tries to use a GL
- * function that is not supported on the current implementation.
- *
- * This function terminates the test with a SKIP; this saves the
- * piglit test from the burden of having to pre-check whether the
- * implementation supports the functionality being tested.
- */
-static void
-default_unsupported(const char *name)
-{
-	printf("Function \"%s\" not supported on this implementation\n", name);
-	piglit_report_result(PIGLIT_SKIP);
-}
-
-/**
- * Generated code calls this function if a call to GetProcAddress()
- * returns NULL.
- *
- * We don't expect this to ever happen, since we only call
- * GetProcAddress() for functions that the implementation claims to
- * support.  So if it does happen we terminate the test with a FAIL.
- */
-static void
-default_get_proc_address_failure(const char *function_name)
-{
-	printf("GetProcAddress failed for \"%s\"\n", function_name);
-	piglit_report_result(PIGLIT_FAIL);
-}
-
-#if defined(_WIN32)
-
-/**
- * This function is used to retrieve the address of GL extension
- * functions, and core GL functions for GL versions above 1.3, on
- * Windows.
- */
-static piglit_dispatch_function_ptr
-get_ext_proc_address(const char *function_name)
-{
-	return (piglit_dispatch_function_ptr) wglGetProcAddress(function_name);
-}
-
-/**
- * This function is used to retrieve the address of core GL functions
- * on windows.
- */
-static piglit_dispatch_function_ptr
-get_core_proc_address(const char *function_name, int gl_10x_version)
-{
-	if (gl_10x_version > 11) {
-		return get_ext_proc_address(function_name);
-	} else {
-		return (piglit_dispatch_function_ptr)
-			GetProcAddress(LoadLibraryA("OPENGL32"), function_name);
-	}
-}
-
-#elif defined(__APPLE__)
-
-/**
- * This function is used to retrieve the address of all GL functions
- * on Apple.
- */
-static piglit_dispatch_function_ptr
-get_ext_proc_address(const char *function_name)
-{
-	static const char *opengl_path =
-		"/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL";
-	static void *opengl_lib = NULL;
-
-	/* Dynamically load lib */
-	if (!opengl_lib)
-	{
-		opengl_lib = dlopen(opengl_path, RTLD_LAZY);
-		if (!opengl_lib)
-			return NULL;
-	}
-
-	return (piglit_dispatch_function_ptr) dlsym(opengl_lib, function_name);
-}
-
-/**
- * This function is used to retrieve the address of core GL functions
- * on Apple.
- */
-static piglit_dispatch_function_ptr
-get_core_proc_address(const char *function_name, int gl_10x_version)
-{
-	/* We don't need to worry about the GL version, since on Apple
-	 * we retrieve all proc addresses in the same way.
-	 */
-	(void) gl_10x_version;
-
-	return get_ext_proc_address(function_name);
-}
-
-#else /* Linux */
-
-/**
- * This function is used to retrieve the address of all GL functions
- * on Linux.
- */
-static piglit_dispatch_function_ptr
-get_ext_proc_address(const char *function_name)
-{
-#if defined(PIGLIT_HAS_GLX)
-	return glXGetProcAddressARB((const GLubyte *) function_name);
-#elif defined(PIGLIT_HAS_EGL)
-	return eglGetProcAddress(function_name);
-#else
-	(void)function_name;
-	return (piglit_dispatch_function_ptr)NULL;
-#endif
-}
-
-/**
- * This function is used to retrieve the address of core GL functions
- * on Linux.
- */
-static piglit_dispatch_function_ptr
-get_core_proc_address(const char *function_name, int gl_10x_version)
-{
-	/* We don't need to worry about the GL version, since on Apple
-	 * we retrieve all proc addresses in the same way.
-	 */
-	(void) gl_10x_version;
-
-	return get_ext_proc_address(function_name);
-}
-
-#endif
-
-/**
- * Initialize the GL dispatch mechanism to a default configuration.
- *
- * Eventually we will want to replace this with code that initializes
- * the GL dispatch mechanism based on run-time parameters (e.g. to
- * select X vs Wayland, or desktop GL vs GLES).
- *
- * This function is safe to call multiple times--it only has an effect
- * on the first call.
- */
-void
-piglit_dispatch_default_init(piglit_dispatch_api api)
-{
-	static bool already_initialized = false;
-
-	if (already_initialized)
-		return;
-
-	piglit_dispatch_init(api,
-			     get_core_proc_address,
-			     get_ext_proc_address,
-			     default_unsupported,
-			     default_get_proc_address_failure);
-
-	already_initialized = true;
-}
diff --git a/tests/util/piglit-dispatch.c b/tests/util/piglit-dispatch.c
deleted file mode 100644
index 5284b7d..0000000
--- a/tests/util/piglit-dispatch.c
+++ /dev/null
@@ -1,304 +0,0 @@
-/* Copyright 2012 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#include "piglit-dispatch.h"
-#include "piglit-util-gl-common.h"
-
-#if defined(PIGLIT_USE_WAFFLE)
-#include <waffle.h>
-#include "piglit-util-waffle.h"
-#include "piglit-framework-gl.h"
-#endif
-
-#ifdef _WIN32
-#define inline __inline
-#endif
-
-/* Global state maintained by the Piglit dispatch mechanism: */
-
-/**
- * Which function to call to get the address of a core function.
- */
-static piglit_get_core_proc_address_function_ptr get_core_proc_address = NULL;
-
-/**
- * Which function to call to get the address of a function defined in
- * an extension.
- */
-static piglit_get_ext_proc_address_function_ptr get_ext_proc_address = NULL;
-
-/**
- * Which function to call if the test attempts to call a function that
- * is not supported by the implementation.
- */
-static piglit_error_function_ptr unsupported = NULL;
-
-/**
- * Which function to call if get_core_proc_address or
- * get_ext_proc_address returns NULL.
- */
-static piglit_error_function_ptr get_proc_address_failure = NULL;
-
-/**
- * The GL version extracted from glGetString(GL_VERSION), times 10.
- * For example, if the GL version is 2.1, the value 21 is stored here.
- *
- * We cache this here because calling glGetString is prohibited
- * between glBegin and glEnd, and to avoid the inefficiency of
- * redundant glGetString queries.
- */
-static int gl_version = 0;
-
-/**
- * True if piglit_dispatch_init has been called.
- */
-static bool is_initialized = false;
-
-static piglit_dispatch_api dispatch_api;
-
-/**
- * Generated code calls this function to verify that the dispatch
- * mechanism has been properly initialized.
- */
-static void
-check_initialized()
-{
-	if (is_initialized)
-		return;
-
-	printf("piglit_dispatch_init() must be called before GL functions\n");
-	assert(false);
-	exit(1);
-}
-
-#ifdef PIGLIT_USE_WAFFLE
-static enum waffle_enum piglit_waffle_dl = WAFFLE_DL_OPENGL;
-
-/**
- * Generated code calls this function to retrieve the address of a
- * core function.
- */
-static piglit_dispatch_function_ptr
-get_wfl_core_proc(const char *name, int gl_10x_version)
-{
-	piglit_dispatch_function_ptr func;
-
-	func = (piglit_dispatch_function_ptr)waffle_dl_sym(piglit_waffle_dl,
-							   name);
-	if (!func)
-		wfl_log_error(__FUNCTION__);
-
-	return func;
-}
-
-/**
- * Generated code calls this function to retrieve the address of a
- * core function.
- */
-static piglit_dispatch_function_ptr
-get_wfl_ext_proc(const char *name)
-{
-	piglit_dispatch_function_ptr func;
-
-	func = (piglit_dispatch_function_ptr)waffle_get_proc_address(name);
-	if (!func)
-		wfl_log_error(__FUNCTION__);
-
-	return func;
-}
-#endif
-
-/**
- * Generated code calls this function to retrieve the address of a
- * core function.
- */
-static piglit_dispatch_function_ptr
-get_core_proc(const char *name, int gl_10x_version)
-{
-	piglit_dispatch_function_ptr function_pointer = get_core_proc_address(name, gl_10x_version);
-	if (function_pointer == NULL)
-		get_proc_address_failure(name);
-	return function_pointer;
-}
-
-/**
- * Generated code calls this function to retrieve the address of a
- * function defined in an extension.
- */
-static piglit_dispatch_function_ptr
-get_ext_proc(const char *name)
-{
-	piglit_dispatch_function_ptr function_pointer = get_ext_proc_address(name);
-	if (function_pointer == NULL)
-		get_proc_address_failure(name);
-	return function_pointer;
-}
-
-/**
- * Generated code calls this function to determine whether a given GL
- * version is supported.
- */
-static inline bool
-check_version(int required_version)
-{
-	return gl_version >= required_version;
-}
-
-/**
- * Generated code calls this function to determine whether a given
- * extension is supported.
- */
-static inline bool
-check_extension(const char *name)
-{
-	return piglit_is_extension_supported(name);
-}
-
-#include "generated_dispatch.c"
-
-/**
- * Initialize the dispatch mechanism.
- *
- * \param api is the API under test.  This determines whether
- * deprecated functionality is supported (since deprecated functions
- * cannot be used in forward compatible contexts).  It also affects
- * which GL version is queried for (since, for example a function
- * might be supported in GLES as of version 2.0, but in OpenGL only as
- * of version 2.1).  Not yet implemented.
- *
- * \param get_core_proc and get_ext_proc are the functions to call to
- * retrieve the address of a core GL function or an extension
- * function.  Note that for OpenGL, these can both map to the same
- * function (e.g. glXGetProcAddressARB).  However, in GLES, core
- * functions are not allowed to be queried using the GetProcAddress
- * mechanism, so get_core_proc will need to be implemented by looking
- * up a symbol in a shared library (e.g. using dlsym()).  When Waffle
- * is in use, these are ignored and replaced with the Waffle functions
- * that do the appropriate lookup according to the platform.  One day
- * we'll drop non-waffle support and remove this part of the
- * interface.
- *
- * \param unsupported_proc is the function to call if a test attempts
- * to use unsupported GL functionality.  It is passed the name of the
- * function that the test attempted to use.
- *
- * \param failure_proc is the function to call if a call to
- * get_core_proc() or get_ext_proc() unexpectedly returned NULL.  It
- * is passed the name of the function that was passed to
- * get_core_proc() or get_ext_proc().
- */
-void
-piglit_dispatch_init(piglit_dispatch_api api,
-		     piglit_get_core_proc_address_function_ptr get_core_proc,
-		     piglit_get_ext_proc_address_function_ptr get_ext_proc,
-		     piglit_error_function_ptr unsupported_proc,
-		     piglit_error_function_ptr failure_proc)
-{
-	dispatch_api = api;
-
-	get_core_proc_address = get_core_proc;
-	get_ext_proc_address = get_ext_proc;
-	unsupported = unsupported_proc;
-	get_proc_address_failure = failure_proc;
-
-#ifdef PIGLIT_USE_WAFFLE
-	switch (api) {
-	case PIGLIT_DISPATCH_GL:
-		piglit_waffle_dl = WAFFLE_DL_OPENGL;
-		break;
-	case PIGLIT_DISPATCH_ES1:
-		piglit_waffle_dl = WAFFLE_DL_OPENGL_ES1;
-		break;
-	case PIGLIT_DISPATCH_ES2:
-		piglit_waffle_dl = WAFFLE_DL_OPENGL_ES2;
-		break;
-	}
-
-	if (gl_fw) {
-		get_core_proc_address = get_wfl_core_proc;
-		get_ext_proc_address = get_wfl_ext_proc;
-	}
-#endif
-
-	/* No need to reset the dispatch pointers the first time */
-	if (is_initialized) {
-		reset_dispatch_pointers();
-	}
-
-	is_initialized = true;
-
-	/* Store the GL version and extension string for use by
-	 * check_version() and check_extension().  Note: the
-	 * following two calls are safe because the only GL function
-	 * they call is glGetString(), and the stub function for
-	 * glGetString does not need to call check_version() or
-	 * check_extension().
-	 */
-	gl_version = piglit_get_gl_version();
-}
-
-/**
- * Compare two strings in the function_names table.
- */
-static int compare_function_names(const void *x, const void *y)
-{
-	const char *x_str = *(const char * const *) x;
-	const char *y_str = *(const char * const *) y;
-	return strcmp(x_str, y_str);
-}
-
-/**
- * Retrieve a GL function pointer given the function name.
- *
- * This function is similar to glXGetProcAddressARB(), except that:
- *
- * - It is platform-independent.
- *
- * - It may be called on any supported function, regardless of whether
- *   the function is defined in GL core or an extension, and
- *   regardless of whether desktop GL or GLES is in use.
- *
- * - Synonymous function names (e.g. glMapBuffer and glMapBufferARB)
- *   may be used interchangably; the correct function is automatically
- *   chosen based on the GL version and extension string.
- *
- * - If the requested function is not supported by the implementation,
- *   the unsupported_proc that was passed to piglit_dispatch_init() is
- *   called.
- */
-piglit_dispatch_function_ptr
-piglit_dispatch_resolve_function(const char *name)
-{
-	size_t item_size = sizeof(function_names[0]);
-	size_t num_items = ARRAY_SIZE(function_names);
-	const char * const *item = (const char * const *)
-		bsearch(&name, function_names, num_items, item_size,
-			compare_function_names);
-	check_initialized();
-	if (!item) {
-		unsupported(name);
-		return NULL;
-	} else {
-		size_t item_index = item - function_names;
-		return function_resolvers[item_index]();
-	}
-}
diff --git a/tests/util/piglit-dispatch.h b/tests/util/piglit-dispatch.h
deleted file mode 100644
index 669aecc..0000000
--- a/tests/util/piglit-dispatch.h
+++ /dev/null
@@ -1,175 +0,0 @@
-/* Copyright 2012 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-/** \file piglit-dispatch.h
- *
- * Dispatch mechanism providing Piglit with access to:
- *
- * - Enum values defined by OpenGL, GLES, and extensions.  The enums
- *   are declared as simple #defines.
- *
- * - Functions defined by OpenGL, GLES, and extensions.  Each function
- *   is represented by a function pointer, which initially points to a
- *   stub function.  When the stub function is called, it looks up the
- *   appropriate function in the GL or GLES implementation, and
- *   updates the function pointer to point to it.  Then it defers to
- *   that function.
- *
- * The dispatch mechanism understands function aliases.  So, for
- * example, since glMapBuffer and glMapBufferARB are synonymous, you
- * may safely call either function.  The dispatch mechanism will
- * transparently map to whichever function the implementation
- * supports.
- *
- * You may also translate a function name to a function pointer at run
- * time by calling piglit_dispatch_resolve_function().
- *
- * The dispatch mechanism must be initialized before its first use.
- * The initialization function, piglit_dispatch_init(), allows the
- * caller to specify which API is in use, how to look up function
- * pointers, what to do in the event of an error, and what to do if an
- * unsupported function is requested.
- */
-
-#ifndef __piglit_dispatch_h__
-#define __piglit_dispatch_h__
-
-#include <stdint.h>
-#include <stddef.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _WIN32
-
-/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
-#define APIENTRY
-#define GLAPIENTRY
-
-#else
-
-#ifndef APIENTRY
-#define APIENTRY __stdcall
-#endif
-
-#ifndef GLAPIENTRY
-#define GLAPIENTRY APIENTRY
-#endif
-
-#ifndef GLAPI
-#define GLAPI extern
-#endif
-
-#endif
-
-typedef unsigned int GLenum;
-typedef unsigned int GLbitfield;
-typedef unsigned int GLuint;
-typedef int GLint;
-typedef int GLsizei;
-typedef int GLfixed;
-typedef unsigned char GLboolean;
-typedef signed char GLbyte;
-typedef short GLshort;
-typedef unsigned char GLubyte;
-typedef unsigned short GLushort;
-typedef unsigned long GLulong;
-typedef float GLfloat;
-typedef float GLclampf;
-typedef double GLdouble;
-typedef double GLclampd;
-typedef void GLvoid;
-typedef int64_t GLint64EXT;
-typedef uint64_t GLuint64EXT;
-typedef GLint64EXT  GLint64;
-typedef GLuint64EXT GLuint64;
-typedef struct __GLsync *GLsync;
-
-typedef char GLchar;
-
-typedef ptrdiff_t GLintptr;
-typedef ptrdiff_t GLsizeiptr;
-
-typedef ptrdiff_t GLintptrARB;
-typedef ptrdiff_t GLsizeiptrARB;
-
-typedef char GLcharARB;
-typedef unsigned int GLhandleARB;
-
-struct _cl_context;
-struct _cl_event;
-
-typedef GLintptr GLvdpauSurfaceNV;
-typedef unsigned short GLhalfNV;
-
-typedef void *GLeglImageOES;
-
-typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-
-typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-
-typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-
-typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,GLvoid *userParam);
-
-typedef void (APIENTRY *piglit_dispatch_function_ptr)(void);
-
-typedef piglit_dispatch_function_ptr (*piglit_get_core_proc_address_function_ptr)(const char *, int);
-
-typedef piglit_dispatch_function_ptr (*piglit_get_ext_proc_address_function_ptr)(const char *);
-
-typedef piglit_dispatch_function_ptr (*piglit_dispatch_resolver_ptr)();
-
-typedef void (*piglit_error_function_ptr)(const char *);
-
-typedef enum {
-	PIGLIT_DISPATCH_GL,
-	PIGLIT_DISPATCH_ES1,
-	PIGLIT_DISPATCH_ES2
-} piglit_dispatch_api;
-
-void piglit_dispatch_init(piglit_dispatch_api api,
-			  piglit_get_core_proc_address_function_ptr get_core_proc,
-			  piglit_get_ext_proc_address_function_ptr get_ext_proc,
-			  piglit_error_function_ptr unsupported_proc,
-			  piglit_error_function_ptr failure_proc);
-
-piglit_dispatch_function_ptr
-piglit_dispatch_resolve_function(const char *name);
-
-#include "generated_dispatch.h"
-
-void piglit_dispatch_default_init(piglit_dispatch_api api);
-
-/* Prevent gl.h from being included, since it will attempt to define
- * the functions we've already defined.
- */
-#define __gl_h_
-#define __gltypes_h_
-#define __glext_h_
-
-#ifdef __cplusplus
-} /* end extern "C" */
-#endif
-
-#endif /* __piglit_dispatch_h__ */
diff --git a/tests/util/piglit-framework-gl/piglit_fbo_framework.c b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
index 027b400..7bbe18a 100644
--- a/tests/util/piglit-framework-gl/piglit_fbo_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
@@ -66,8 +66,6 @@ init_gl(struct piglit_wfl_framework *wfl_fw)
 	GLenum status;
 
 #ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-
 	if (piglit_get_gl_version() < 20)
 		return false;
 #endif
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 716f314..ee9d27d 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -124,10 +124,6 @@ init_glut(void)
 	glutDisplayFunc(display);
 	glutReshapeFunc(default_reshape_func);
 	glutKeyboardFunc(piglit_escape_exit_key);
-
-#ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-#endif
 }
 
 static void
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 0d09032..8f63f0a 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -446,12 +446,6 @@ make_context_current_singlepass(struct piglit_wfl_framework *wfl_fw,
 	                         wfl_fw->window,
 	                         wfl_fw->context);
 
-#ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
-#elif defined(PIGLIT_USE_OPENGL_ES2) || defined(PIGLIT_USE_OPENGL_ES3)
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_ES2);
-#endif
-
 	ok = check_gl_version(test_config, flavor, ctx_desc);
 	if (!ok)
 	   goto fail;
diff --git a/tests/util/piglit-framework-gl/piglit_x11_framework.c b/tests/util/piglit-framework-gl/piglit_x11_framework.c
index 8b3d3d7..b31a971 100644
--- a/tests/util/piglit-framework-gl/piglit_x11_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_x11_framework.c
@@ -25,18 +25,7 @@
 #error "Cannot build piglit_x11_framework.c without PIGLIT_HAS_X11"
 #endif
 
-#include <piglit/gl_wrap.h>
-
-/* If building for a GLES API, <piglit/gl_wrap.h> may include the GLES
- * headers, such as <GLES2/gl2.h>. Below, <waffle_glx.h> transitively includes
- * <GL/gl.h>, which defines some of the same symbols found in <GLES2/gl2.h>.
- * We define the include guards below in order to prevent <GL/gl.h> and
- * related headers from being included and causing compilation failure due to
- * symbol redefinitions.
- */
-#define __gl_h_
-#define __gltypes_h_
-#define __glext_h_
+#include <epoxy/gl.h>
 
 #include <assert.h>
 #include <unistd.h>
diff --git a/tests/util/piglit-shader.h b/tests/util/piglit-shader.h
index e0503e6..e2eef03 100644
--- a/tests/util/piglit-shader.h
+++ b/tests/util/piglit-shader.h
@@ -52,51 +52,6 @@ GLint piglit_build_simple_program_multiple_shaders(GLenum target1,
 extern GLboolean piglit_program_pipeline_check_status(GLuint pipeline);
 extern GLboolean piglit_program_pipeline_check_status_quiet(GLuint pipeline);
 
-#if defined(PIGLIT_USE_OPENGL_ES1)
-#define glAttachShader assert(!"glAttachShader does not exist in ES1")
-#define glBindAttribLocation assert(!"glBindAttribLocation does not exist in ES1")
-#define glCompileShader assert(!"glCompileShader does not exist in ES1")
-#define glCreateProgram assert(!"glCreateProgram does not exist in ES1")
-#define glCreateShader assert(!"glCreateShader does not exist in ES1")
-#define glDeleteProgram assert(!"glDeleteProgram does not exist in ES1")
-#define glDeleteShader assert(!"glDeleteShader does not exist in ES1")
-#define glGetActiveUniform assert(!"glGetActiveUniform does not exist in ES1")
-#define glGetAttribLocation assert(!"glGetAttribLocation does not exist in ES1")
-#define glGetProgramInfoLog assert(!"glGetProgramInfoLog does not exist in ES1")
-#define glGetProgramiv assert(!"glGetProgramiv does not exist in ES1")
-#define glGetShaderInfoLog assert(!"glGetShaderInfoLog does not exist in ES1")
-#define glGetShaderiv assert(!"glGetShaderiv does not exist in ES1")
-#define glGetUniformLocation assert(!"glGetUniformLocation does not exist in ES1")
-#define glLinkProgram assert(!"glLinkProgram does not exist in ES1")
-#define glShaderSource assert(!"glShaderSource does not exist in ES1")
-#define glUseProgram assert(!"glUseProgram does not exist in ES1")
-#define glUniform1f assert(!"glUniform1f does not exist in ES1")
-#define glUniform2f assert(!"glUniform2f does not exist in ES1")
-#define glUniform3f assert(!"glUniform3f does not exist in ES1")
-#define glUniform4f assert(!"glUniform4f does not exist in ES1")
-#define glUniform1fv assert(!"glUniform1fv does not exist in ES1")
-#define glUniform2fv assert(!"glUniform2fv does not exist in ES1")
-#define glUniform3fv assert(!"glUniform3fv does not exist in ES1")
-#define glUniform4fv assert(!"glUniform4fv does not exist in ES1")
-#define glUniform1i assert(!"glUniform1i does not exist in ES1")
-#define glUniform2iv assert(!"glUniform2iv does not exist in ES1")
-#define glUniform3iv assert(!"glUniform3iv does not exist in ES1")
-#define glUniform4iv assert(!"glUniform4iv does not exist in ES1")
-#define glUniformMatrix2fv assert(!"glUniformMatrix2fv does not exist in ES1")
-#define glUniformMatrix3fv assert(!"glUniformMatrix3fv does not exist in ES1")
-#define glUniformMatrix4fv assert(!"glUniformMatrix4fv does not exist in ES1")
-#define glGetUniformfv assert(!"glGetUniformfv does not exist in ES1")
-#define glVertexAttribPointer assert(!"glVertexAttribPointer does not exist in ES1")
-#define glEnableVertexAttribArray assert(!"glEnableVertexAttribArray does not exist in ES1")
-#define glDisableVertexAttribArray assert(!"glDisableVertexAttribArray does not exist in ES1")
-#define glUniformMatrix2x3fv assert(!"glUniformMatrix2x3fv does not exist in ES1")
-#define glUniformMatrix2x4fv assert(!"glUniformMatrix2x4fv does not exist in ES1")
-#define glUniformMatrix3x2fv assert(!"glUniformMatrix3x2fv does not exist in ES1")
-#define glUniformMatrix3x4fv assert(!"glUniformMatrix3x4fv does not exist in ES1")
-#define glUniformMatrix4x2fv assert(!"glUniformMatrix4x2fv does not exist in ES1")
-#define glUniformMatrix4x3fv assert(!"glUniformMatrix4x3fv does not exist in ES1")
-#endif
-
 /**
  * Require a specific version of GLSL.
  *
diff --git a/tests/util/piglit-util-gl-common.h b/tests/util/piglit-util-gl-common.h
index 73f2f83..40c6b7d 100644
--- a/tests/util/piglit-util-gl-common.h
+++ b/tests/util/piglit-util-gl-common.h
@@ -31,11 +31,9 @@ extern "C" {
 
 #include "piglit-util.h"
 
-#include <piglit/gl_wrap.h>
+#include <epoxy/gl.h>
 #include <piglit/glut_wrap.h>
 
-#define piglit_get_proc_address(x) piglit_dispatch_resolve_function(x)
-
 #include "piglit-framework-gl.h"
 #include "piglit-shader.h"
 
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 3bb4adf..9fff9a6 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -738,7 +738,6 @@ int piglit_use_fragment_program(void)
 		"END\n"
 		;
 
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	if (!piglit_is_extension_supported("GL_ARB_fragment_program"))
 		return 0;
 
@@ -758,7 +757,6 @@ void piglit_require_fragment_program(void)
 
 int piglit_use_vertex_program(void)
 {
-	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	return piglit_is_extension_supported("GL_ARB_vertex_program");
 }
 
diff --git a/tests/util/piglit_ktx.h b/tests/util/piglit_ktx.h
index d150423..9b063c2 100644
--- a/tests/util/piglit_ktx.h
+++ b/tests/util/piglit_ktx.h
@@ -37,7 +37,7 @@
 #include <stdio.h>
 #include <stdint.h>
 
-#include <piglit/gl_wrap.h>
+#include <epoxy/gl.h>
 
 #ifdef __cplusplus
 extern "C" {
-- 
1.8.5.3



More information about the Piglit mailing list