[Piglit] [PATCH 02/14] piglit: Make callers of piglit_dispatch_default_init() specify the API.

Eric Anholt eric at anholt.net
Wed Jun 5 16:14:19 PDT 2013


To automatically detect the current API, we'd need to make calls to
piglit_is_gles() and piglit_get_gl_version(), while bypassing the
dispatch mechanism we're trying to initialize.  That seems tricky,
while the context type is probably going to be known by the caller
when we extend dispatch to GLES tests.
---
 tests/egl/egl-util.c                                                  | 2 +-
 tests/egl/spec/egl_khr_create_context/default-major-version-gl.c      | 2 +-
 tests/egl/spec/egl_khr_create_context/default-major-version-gles.c    | 2 +-
 tests/egl/spec/egl_khr_create_context/default-minor-version-gl.c      | 2 +-
 tests/egl/spec/egl_khr_create_context/default-minor-version-gles.c    | 2 +-
 tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gl.c      | 2 +-
 tests/egl/spec/egl_khr_create_context/valid-attribute-empty-gles.c    | 2 +-
 tests/egl/spec/egl_khr_create_context/valid-attribute-null-gl.c       | 2 +-
 tests/egl/spec/egl_khr_create_context/valid-attribute-null-gles.c     | 2 +-
 .../spec/egl_khr_create_context/valid-flag-forward-compatible-gl.c    | 2 +-
 tests/egl/spec/egl_khr_create_context/verify-gl-flavor.c              | 2 +-
 tests/general/windowoverlap.c                                         | 2 +-
 tests/glean/tbase.h                                                   | 2 +-
 tests/glx/glx-copy-sub-buffer.c                                       | 2 +-
 tests/glx/glx-destroycontext-1.c                                      | 2 +-
 tests/glx/glx-destroycontext-2.c                                      | 2 +-
 tests/glx/glx-fbo-binding.c                                           | 2 +-
 tests/glx/glx-make-current.c                                          | 2 +-
 tests/glx/glx-make-glxdrawable-current.c                              | 2 +-
 tests/glx/glx-multi-context-ib-1.c                                    | 2 +-
 tests/glx/glx-multithread-makecurrent-1.c                             | 2 +-
 tests/glx/glx-multithread-makecurrent-2.c                             | 2 +-
 tests/glx/glx-multithread-makecurrent-3.c                             | 2 +-
 tests/glx/glx-multithread-makecurrent-4.c                             | 2 +-
 tests/glx/glx-multithread-shader-compile.c                            | 2 +-
 tests/glx/glx-multithread.c                                           | 2 +-
 tests/glx/glx-shader-sharing.c                                        | 2 +-
 tests/glx/glx-swap-event.c                                            | 2 +-
 tests/glx/glx-swap-pixmap-bad.c                                       | 2 +-
 tests/glx/glx-swap-pixmap.c                                           | 2 +-
 tests/glx/glx-swap-singlebuffer.c                                     | 2 +-
 tests/glx/glx-tfp.c                                                   | 2 +-
 tests/glx/glx-visuals-depth.c                                         | 2 +-
 tests/glx/glx-visuals-stencil.c                                       | 2 +-
 tests/spec/glx_arb_create_context/default-major-version.c             | 2 +-
 tests/spec/glx_arb_create_context/default-minor-version.c             | 2 +-
 tests/spec/glx_oml_sync_control/common.c                              | 2 +-
 tests/texturing/getteximage-luminance.c                               | 2 +-
 tests/util/piglit-dispatch-init.c                                     | 4 ++--
 tests/util/piglit-dispatch.h                                          | 2 +-
 tests/util/piglit-framework-gl/piglit_fbo_framework.c                 | 2 +-
 tests/util/piglit-framework-gl/piglit_glut_framework.c                | 2 +-
 tests/util/piglit-framework-gl/piglit_wfl_framework.c                 | 2 +-
 tests/util/piglit-util-gl.c                                           | 4 ++--
 44 files changed, 46 insertions(+), 46 deletions(-)

diff --git a/tests/egl/egl-util.c b/tests/egl/egl-util.c
index 4f06cab..012f547 100644
--- a/tests/egl/egl-util.c
+++ b/tests/egl/egl-util.c
@@ -253,7 +253,7 @@ egl_util_run(const struct egl_test *test, int argc, char *argv[])
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	result = event_loop(&state, test);
 
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 b063366..1162d7b 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,7 +63,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 e7da845..da392e9 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,7 +60,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 77050df..37369d5 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,7 +65,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 5fbb8d4..0d02625 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
@@ -65,7 +65,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 fafb01a..5e1ebb3 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,7 +55,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 73892b9..5d631e6 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,7 +54,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 7db99fe..d3ff851 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,7 +52,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 3ab7482..4816976 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,7 +51,7 @@ int main(int argc, char **argv)
 		piglit_report_result(PIGLIT_FAIL);
 	}
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
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 2f2c0a7..7f0f148 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,7 +43,7 @@ static bool try_flag(int flag)
 				piglit_report_result(PIGLIT_FAIL);
 			}
 
-			piglit_dispatch_default_init();
+			piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 			gl_version = piglit_get_gl_version();
 		}
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 69d581b..27ea0b1 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
@@ -235,7 +235,7 @@ check_flavor(int requested_version, enum gl_api requested_api)
 		/* We must postpone initialization of piglit-dispatch until
 		 * a context is current.
 		 */
-		piglit_dispatch_default_init();
+		piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 		is_dispatch_init = true;
 	}
 
diff --git a/tests/general/windowoverlap.c b/tests/general/windowoverlap.c
index d5fe877..6b08a75 100644
--- a/tests/general/windowoverlap.c
+++ b/tests/general/windowoverlap.c
@@ -181,7 +181,7 @@ int main(int argc, char *argv[])
 	glutInitWindowSize(MainWidth, MainHeight);
 	glutInitDisplayMode(PIGLIT_GL_VISUAL_RGB);
 	glutCreateWindow(argv[0]);
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	glutReshapeFunc(Reshape);
 	glutDisplayFunc(RedisplayMain);
 	if (!Automatic)
diff --git a/tests/glean/tbase.h b/tests/glean/tbase.h
index 5e2feff..b5fe2c5 100644
--- a/tests/glean/tbase.h
+++ b/tests/glean/tbase.h
@@ -313,7 +313,7 @@ public:
 
 				// Make sure glew is initialized so we can call
 				// GL functions safely.
-				piglit_dispatch_default_init();
+				piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 				// Check if test is applicable to this context
 				if (!isApplicable())
diff --git a/tests/glx/glx-copy-sub-buffer.c b/tests/glx/glx-copy-sub-buffer.c
index c6561f8..b0d7d97 100644
--- a/tests/glx/glx-copy-sub-buffer.c
+++ b/tests/glx/glx-copy-sub-buffer.c
@@ -52,7 +52,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win_one, ctx);
-	piglit_dispatch_default_init();
+	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 91dc82f..fc27b6e 100644
--- a/tests/glx/glx-destroycontext-1.c
+++ b/tests/glx/glx-destroycontext-1.c
@@ -48,7 +48,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 9c591a0..e4c6d37 100644
--- a/tests/glx/glx-destroycontext-2.c
+++ b/tests/glx/glx-destroycontext-2.c
@@ -48,7 +48,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 090cd09..bfdc4dd 100644
--- a/tests/glx/glx-fbo-binding.c
+++ b/tests/glx/glx-fbo-binding.c
@@ -111,7 +111,7 @@ main(int argc, char **argv)
    ctx = piglit_get_glx_context(dpy, visinfo);
 
    glXMakeCurrent(dpy, Windows[0], ctx);
-   piglit_dispatch_default_init();
+   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 d56fcdb..dde99b4 100644
--- a/tests/glx/glx-make-current.c
+++ b/tests/glx/glx-make-current.c
@@ -49,7 +49,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win_one, ctx);
-	piglit_dispatch_default_init();
+	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 919458d..fc339be 100644
--- a/tests/glx/glx-make-glxdrawable-current.c
+++ b/tests/glx/glx-make-glxdrawable-current.c
@@ -76,7 +76,7 @@ draw(Display *dpy)
 	ctx = piglit_get_glx_context(dpy, visinfo);
 
 	glXMakeCurrent(dpy, glxwin_one, ctx);
-	piglit_dispatch_default_init();
+	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 1e77b7a..2b3c00e 100644
--- a/tests/glx/glx-multi-context-ib-1.c
+++ b/tests/glx/glx-multi-context-ib-1.c
@@ -189,7 +189,7 @@ main(int argc, char **argv)
 	ctx1 = piglit_get_glx_context(dpy, visinfo);
 
 	glXMakeCurrent(dpy, win, ctx0);
-	piglit_dispatch_default_init();
+	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 f8132db..97dc1cd 100644
--- a/tests/glx/glx-multithread-makecurrent-1.c
+++ b/tests/glx/glx-multithread-makecurrent-1.c
@@ -107,7 +107,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 1bb4519..d9714ec 100644
--- a/tests/glx/glx-multithread-makecurrent-2.c
+++ b/tests/glx/glx-multithread-makecurrent-2.c
@@ -108,7 +108,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 a7df147..dc93d33 100644
--- a/tests/glx/glx-multithread-makecurrent-3.c
+++ b/tests/glx/glx-multithread-makecurrent-3.c
@@ -100,7 +100,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 7ebeb5f..53cb297 100644
--- a/tests/glx/glx-multithread-makecurrent-4.c
+++ b/tests/glx/glx-multithread-makecurrent-4.c
@@ -100,7 +100,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 b04c1b2..3c77af3 100644
--- a/tests/glx/glx-multithread-shader-compile.c
+++ b/tests/glx/glx-multithread-shader-compile.c
@@ -72,7 +72,7 @@ thread_func(void *arg)
 		 * on the same type of context.
                  */
 		pthread_mutex_lock(&mutex);
-		piglit_dispatch_default_init();
+		piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 		pthread_mutex_unlock(&mutex);
 
 		vert_shader = piglit_compile_shader_text(GL_VERTEX_SHADER, vert_shader_text);
diff --git a/tests/glx/glx-multithread.c b/tests/glx/glx-multithread.c
index 3d162b0..f88f8da 100644
--- a/tests/glx/glx-multithread.c
+++ b/tests/glx/glx-multithread.c
@@ -79,7 +79,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 c1ed9fa..1b180ae 100644
--- a/tests/glx/glx-shader-sharing.c
+++ b/tests/glx/glx-shader-sharing.c
@@ -88,7 +88,7 @@ draw(Display *dpy)
     */
    glXMakeCurrent(dpy, win, ctx1);
 
-   piglit_dispatch_default_init();
+   piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
    if (piglit_get_gl_version() < 20) {
       printf("%s: Requires OpenGL 2.0\n", TestName);
diff --git a/tests/glx/glx-swap-event.c b/tests/glx/glx-swap-event.c
index e8f8bd4..310e634 100644
--- a/tests/glx/glx-swap-event.c
+++ b/tests/glx/glx-swap-event.c
@@ -533,7 +533,7 @@ main(int argc, char *argv[])
             piglit_report_result(PIGLIT_FAIL);
         }
     }
-    piglit_dispatch_default_init();
+    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 bc471fc..52a0749 100644
--- a/tests/glx/glx-swap-pixmap-bad.c
+++ b/tests/glx/glx-swap-pixmap-bad.c
@@ -73,7 +73,7 @@ main(int argc, char **argv)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, g, ctx);
-	piglit_dispatch_default_init();
+	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 855396a..7635e0d 100644
--- a/tests/glx/glx-swap-pixmap.c
+++ b/tests/glx/glx-swap-pixmap.c
@@ -67,7 +67,7 @@ main(int argc, char **argv)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, g, ctx);
-	piglit_dispatch_default_init();
+	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 73a065d..a747149 100644
--- a/tests/glx/glx-swap-singlebuffer.c
+++ b/tests/glx/glx-swap-singlebuffer.c
@@ -48,7 +48,7 @@ draw(Display *dpy)
 
 	ctx = piglit_get_glx_context(dpy, visinfo);
 	glXMakeCurrent(dpy, win, ctx);
-	piglit_dispatch_default_init();
+	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 659c452..413d920 100644
--- a/tests/glx/glx-tfp.c
+++ b/tests/glx/glx-tfp.c
@@ -320,7 +320,7 @@ int main(int argc, char**argv)
 
 	glXMakeCurrent(dpy, win, ctx);
 
-	piglit_dispatch_default_init();
+	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 e7dad45..8db98bb 100644
--- a/tests/glx/glx-visuals-depth.c
+++ b/tests/glx/glx-visuals-depth.c
@@ -50,7 +50,7 @@ draw(Display *dpy, GLXFBConfig config)
 	float *left, *right;
 	bool pass = true;
 
-	piglit_dispatch_default_init();
+	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 d82675b..12fcfd3 100644
--- a/tests/glx/glx-visuals-stencil.c
+++ b/tests/glx/glx-visuals-stencil.c
@@ -50,7 +50,7 @@ draw(Display *dpy, GLXFBConfig config)
 	float *left, *right;
 	bool pass = true;
 
-	piglit_dispatch_default_init();
+	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/glx_arb_create_context/default-major-version.c b/tests/spec/glx_arb_create_context/default-major-version.c
index df6aabd..07bff27 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,7 @@ int main(int argc, char **argv)
 	 */
 	ctx = glXCreateContextAttribsARB(dpy, fbconfig, NULL, True, attribs);
 	glXMakeContextCurrent(dpy, glxWin, glxWin, ctx);
-	piglit_dispatch_default_init();
+	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 35c800e..f32e991 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,7 @@ int main(int argc, char **argv)
 	}
 
 	glXMakeContextCurrent(dpy, glxWin, glxWin, ctx);
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	version_string = (char *) glGetString(GL_VERSION);
 
diff --git a/tests/spec/glx_oml_sync_control/common.c b/tests/spec/glx_oml_sync_control/common.c
index db4c3aa..d5011a8 100644
--- a/tests/spec/glx_oml_sync_control/common.c
+++ b/tests/spec/glx_oml_sync_control/common.c
@@ -80,7 +80,7 @@ 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_default_init(PIGLIT_DISPATCH_GL);
 
 	XMapWindow(dpy, win);
 
diff --git a/tests/texturing/getteximage-luminance.c b/tests/texturing/getteximage-luminance.c
index 0c6033d..389c3a2 100644
--- a/tests/texturing/getteximage-luminance.c
+++ b/tests/texturing/getteximage-luminance.c
@@ -251,5 +251,5 @@ piglit_display(void)
 void
 piglit_init(int argc, char **argv)
 {
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 }
diff --git a/tests/util/piglit-dispatch-init.c b/tests/util/piglit-dispatch-init.c
index 1430a36..8984815 100644
--- a/tests/util/piglit-dispatch-init.c
+++ b/tests/util/piglit-dispatch-init.c
@@ -174,14 +174,14 @@ get_core_proc_address(const char *function_name, int gl_10x_version)
  * on the first call.
  */
 void
-piglit_dispatch_default_init()
+piglit_dispatch_default_init(piglit_dispatch_api api)
 {
 	static bool already_initialized = false;
 
 	if (already_initialized)
 		return;
 
-	piglit_dispatch_init(PIGLIT_DISPATCH_GL,
+	piglit_dispatch_init(api,
 			     get_core_proc_address,
 			     get_ext_proc_address,
 			     default_unsupported,
diff --git a/tests/util/piglit-dispatch.h b/tests/util/piglit-dispatch.h
index 98a980f..eed2023 100644
--- a/tests/util/piglit-dispatch.h
+++ b/tests/util/piglit-dispatch.h
@@ -156,7 +156,7 @@ piglit_dispatch_resolve_function(const char *name);
 
 #include "generated_dispatch.h"
 
-void piglit_dispatch_default_init();
+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.
diff --git a/tests/util/piglit-framework-gl/piglit_fbo_framework.c b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
index 1b844bb..f71db47 100644
--- a/tests/util/piglit-framework-gl/piglit_fbo_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_fbo_framework.c
@@ -71,7 +71,7 @@ init_gl(struct piglit_wfl_framework *wfl_fw)
 	GLenum status;
 
 #ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 
 	if (piglit_get_gl_version() < 20)
 		return false;
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index cfadf77..5f3c5f7 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -126,7 +126,7 @@ init_glut(void)
 	glutKeyboardFunc(piglit_escape_exit_key);
 
 #ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 #endif
 }
 
diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 801a258..2cce282 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -361,7 +361,7 @@ make_context_current_singlepass(struct piglit_wfl_framework *wfl_fw,
 	                         wfl_fw->context);
 
 #ifdef PIGLIT_USE_OPENGL
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 #endif
 
 	ok = check_gl_version(test_config, flavor);
diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index 0a56582..65856d1 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -714,7 +714,7 @@ int piglit_use_fragment_program(void)
 		"END\n"
 		;
 
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	if (!piglit_is_extension_supported("GL_ARB_fragment_program"))
 		return 0;
 
@@ -734,7 +734,7 @@ void piglit_require_fragment_program(void)
 
 int piglit_use_vertex_program(void)
 {
-	piglit_dispatch_default_init();
+	piglit_dispatch_default_init(PIGLIT_DISPATCH_GL);
 	return piglit_is_extension_supported("GL_ARB_vertex_program");
 }
 
-- 
1.8.3.rc0



More information about the Piglit mailing list