summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Berry <stereotype441@gmail.com>2012-03-01 16:56:03 -0800
committerPaul Berry <stereotype441@gmail.com>2012-03-23 13:39:58 -0700
commit8b7badfc50fbd92911ef960a8f90a1efd3535d9d (patch)
tree097b99416071b5e0c590d0abf97237fd397adc6f
parent3a786312e69f1ebf0c9a180c0067eee4a9cb725b (diff)
piglit-dispatch: Switch to using piglit-dispatch instead of GLEW.
Previous patches set up the piglit-dispatch infrastructure but did not use it. This patch enables piglit-dispatch and uses it instead of GLEW. - No piglit regressions on Intel SandyBridge (Linux) or the nVidia binary blob for Linux. - One regression on Mac OSX: after this patch, shaders/gpu_shader4_attribs incorrectly skips. This happens because the functions tested by shaders/gpu_shader4_attribs are defined in both EXT_gpu_shader4 and NV_vertex_program4 extensions. Piglit-dispatch is not yet capable of understanding that a function might be defined with the same name in multiple extension specs (because it is based on the gl.spec file from www.opengl.org, which fails to encode this information). I plan to address this in a future patch. - Spot checked on Microsoft Windows. v2: Remove redundant includes of GL headers.
-rw-r--r--src/piglit/gl_wrap.h12
-rw-r--r--tests/glean/glwrap.h2
-rw-r--r--tests/glean/tbase.h2
-rw-r--r--tests/shaders/glsl-fs-pointcoord.c7
-rw-r--r--tests/util/CMakeLists.gl.txt6
-rw-r--r--tests/util/glxew.h1
-rw-r--r--tests/util/piglit-dispatch.h7
-rwxr-xr-xtests/util/piglit-util.h6
8 files changed, 15 insertions, 28 deletions
diff --git a/src/piglit/gl_wrap.h b/src/piglit/gl_wrap.h
index 8fddd2f0..3ccc3658 100644
--- a/src/piglit/gl_wrap.h
+++ b/src/piglit/gl_wrap.h
@@ -43,17 +43,7 @@ extern "C" {
#endif
#if defined(USE_OPENGL)
-# include "glew.h"
- /* Include the real headers too, in case GLEW misses something. */
-# ifdef __APPLE__
-# include <OpenGL/gl.h>
-# include <OpenGL/glu.h>
-# include <OpenGL/glext.h>
-# else
-# include <GL/gl.h>
-# include <GL/glu.h>
-# include <GL/glext.h>
-# endif
+# include "piglit-dispatch.h"
#elif defined(USE_OPENGL_ES1)
# include <GLES/gl.h>
diff --git a/tests/glean/glwrap.h b/tests/glean/glwrap.h
index 465acf1b..d3404b49 100644
--- a/tests/glean/glwrap.h
+++ b/tests/glean/glwrap.h
@@ -48,7 +48,7 @@
#ifndef __glwrap_h__
#define __glwrap_h__
-#include "../util/glew.h"
+#include "../util/piglit-dispatch.h"
#if defined(__WIN__)
# include <windows.h>
diff --git a/tests/glean/tbase.h b/tests/glean/tbase.h
index 748ee62c..f0ec2721 100644
--- a/tests/glean/tbase.h
+++ b/tests/glean/tbase.h
@@ -106,7 +106,7 @@ and tbasic.cpp.
#ifndef __tbase_h__
#define __tbase_h__
-#include "glew.h"
+#include "piglit-dispatch.h"
#ifdef __UNIX__
#include <unistd.h>
diff --git a/tests/shaders/glsl-fs-pointcoord.c b/tests/shaders/glsl-fs-pointcoord.c
index 586789f4..267c4e7b 100644
--- a/tests/shaders/glsl-fs-pointcoord.c
+++ b/tests/shaders/glsl-fs-pointcoord.c
@@ -41,13 +41,6 @@
#include <stdlib.h>
#include <errno.h>
#include <sys/stat.h>
-#define GL_GLEXT_PROTOTYPES
-#include "glew.h"
-#if defined(__APPLE__)
-#include <GLUT/glut.h>
-#else
-#include "GL/glut.h"
-#endif
#include "piglit-util.h"
diff --git a/tests/util/CMakeLists.gl.txt b/tests/util/CMakeLists.gl.txt
index be3f46e8..2c13a737 100644
--- a/tests/util/CMakeLists.gl.txt
+++ b/tests/util/CMakeLists.gl.txt
@@ -6,7 +6,8 @@ include_directories(
set(UTIL_SOURCES
${UTIL_SOURCES}
- glew.c
+ piglit-dispatch.c
+ piglit-dispatch-init.c
piglit-shader.c
piglit-shader-gl.c
piglit-transform-feedback.c
@@ -39,7 +40,8 @@ IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
piglit-util-gl.c
piglit-glx-framework.c
piglit-glx-util.c
- glew.c
+ piglit-dispatch.c
+ piglit-dispatch-init.c
)
set (UTIL_SOURCES
${UTIL_SOURCES}
diff --git a/tests/util/glxew.h b/tests/util/glxew.h
index 1c80ec97..2e855c1b 100644
--- a/tests/util/glxew.h
+++ b/tests/util/glxew.h
@@ -97,7 +97,6 @@
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xmd.h>
-#include "glew.h" /* NOTE: changed for piglit, was <GL/glew.h> */
#ifdef __cplusplus
extern "C" {
diff --git a/tests/util/piglit-dispatch.h b/tests/util/piglit-dispatch.h
index 1eea0e38..08e4dae4 100644
--- a/tests/util/piglit-dispatch.h
+++ b/tests/util/piglit-dispatch.h
@@ -146,6 +146,13 @@ piglit_dispatch_resolve_function(const char *name);
void piglit_dispatch_default_init();
+/* As a temporary measure, redirect glewInit() to
+ * piglit_dispatch_default_init(), so that we don't have to modify
+ * initialization code in old tests that were written before the
+ * piglit-dispatch mechanism.
+ */
+#define glewInit piglit_dispatch_default_init
+
/* Prevent gl.h from being included, since it will attempt to define
* the functions we've already defined.
*/
diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index dd293bbc..775dfe29 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -104,11 +104,7 @@ int asprintf(char **strp, const char *fmt, ...)
# define NAN (INFINITY - INFINITY)
#endif
-#ifdef _WIN32
-# define piglit_get_proc_address(x) wglGetProcAddress(x)
-#else
-# define piglit_get_proc_address(x) glutGetProcAddress(x)
-#endif
+#define piglit_get_proc_address(x) piglit_dispatch_resolve_function(x)
enum piglit_result {
PIGLIT_PASS,