[Piglit] [PATCH 2/3] Transform feedback: Eliminate wrapper functions.

Paul Berry stereotype441 at gmail.com
Mon Jul 2 14:57:33 PDT 2012


The wrapper functions in tests/util/piglit-transform-feedback.{c,h}
(e.g. piglit_BeginTransformFeedback()), are no longer needed, since
the piglit-dispatch mechanism automatically redirects to the EXT
variants when GL 3.0 is not supported.

This patch removes the unnecessary wrapper functions.
---
 tests/util/piglit-transform-feedback.c |   42 +------------------------------
 tests/util/piglit-transform-feedback.h |   38 ----------------------------
 2 files changed, 2 insertions(+), 78 deletions(-)

diff --git a/tests/util/piglit-transform-feedback.c b/tests/util/piglit-transform-feedback.c
index d23e126..173d32d 100644
--- a/tests/util/piglit-transform-feedback.c
+++ b/tests/util/piglit-transform-feedback.c
@@ -31,49 +31,11 @@
 
 #include "piglit-util-gl-common.h"
 
-PFNGLBEGINTRANSFORMFEEDBACKPROC piglit_BeginTransformFeedback = NULL;
-PFNGLBINDBUFFERBASEPROC piglit_BindBufferBase = NULL;
-PFNGLBINDBUFFERRANGEPROC piglit_BindBufferRange = NULL;
-PFNGLENDTRANSFORMFEEDBACKPROC piglit_EndTransformFeedback = NULL;
-PFNGLGETBOOLEANI_VPROC piglit_GetBooleani_v = NULL;
-PFNGLGETINTEGERI_VPROC piglit_GetIntegeri_v = NULL;
-PFNGLGETTRANSFORMFEEDBACKVARYINGPROC piglit_GetTransformFeedbackVarying = NULL;
-PFNGLTRANSFORMFEEDBACKVARYINGSPROC piglit_TransformFeedbackVaryings = NULL;
-
-static void
-init_functions_from_core(void)
-{
-	piglit_BeginTransformFeedback = glBeginTransformFeedback;
-	piglit_BindBufferBase = glBindBufferBase;
-	piglit_BindBufferRange = glBindBufferRange;
-	piglit_EndTransformFeedback = glEndTransformFeedback;
-	piglit_GetBooleani_v = glGetBooleani_v;
-	piglit_GetIntegeri_v = glGetIntegeri_v;
-	piglit_GetTransformFeedbackVarying = glGetTransformFeedbackVarying;
-	piglit_TransformFeedbackVaryings = glTransformFeedbackVaryings;
-}
-
-static void
-init_functions_from_ext(void)
-{
-	piglit_BeginTransformFeedback = glBeginTransformFeedbackEXT;
-	piglit_BindBufferBase = glBindBufferBaseEXT;
-	piglit_BindBufferRange = glBindBufferRangeEXT;
-	piglit_EndTransformFeedback = glEndTransformFeedbackEXT;
-	piglit_GetBooleani_v = glGetBooleanIndexedvEXT;
-	piglit_GetIntegeri_v = glGetIntegerIndexedvEXT;
-	piglit_GetTransformFeedbackVarying = glGetTransformFeedbackVaryingEXT;
-	piglit_TransformFeedbackVaryings = glTransformFeedbackVaryingsEXT;
-}
-
 void
 piglit_require_transform_feedback(void)
 {
-	if (piglit_get_gl_version() >= 30) {
-		init_functions_from_core();
-	} else if (piglit_is_extension_supported("GL_EXT_transform_feedback")) {
-		init_functions_from_ext();
-	} else {
+	if (!(piglit_get_gl_version() >= 30 ||
+	      piglit_is_extension_supported("GL_EXT_transform_feedback"))) {
 		printf("Transform feedback not supported.\n");
 		piglit_report_result(PIGLIT_SKIP);
 		exit(1);
diff --git a/tests/util/piglit-transform-feedback.h b/tests/util/piglit-transform-feedback.h
index fa7c7a9..312bb85 100644
--- a/tests/util/piglit-transform-feedback.h
+++ b/tests/util/piglit-transform-feedback.h
@@ -24,44 +24,6 @@
 #pragma once
 
 /**
- * \name Portable wrappers for transform feedback functions
- *
- * \note
- * \c piglit_require_transform_feedback must be called before using
- * these wrappers.
- */
-/*@{*/
-#if defined(USE_OPENGL_ES1)
-#define piglit_BeginTransformFeedback assert(!"glBeginTransformFeedback does not exist in ES1")
-#define piglit_BindBufferBase assert(!"glBindBufferBase does not exist in ES1")
-#define piglit_BindBufferRange assert(!"glBindBufferRange does not exist in ES1")
-#define piglit_EndTransformFeedback assert(!"glEndTransformFeedback does not exist in ES1")
-#define piglit_GetBooleani_v assert(!"glGetBooleani_v does not exist in ES1")
-#define piglit_GetIntegeri_v assert(!"glGetIntegeri_v does not exist in ES1")
-#define piglit_GetTransformFeedbackVarying assert(!"glGetTransformFeedbackVarying does not exist in ES1")
-#define piglit_TransformFeedbackVaryings assert(!"glTransformFeedbackVaryings does not exist in ES1")
-#elif defined(USE_OPENGL_ES2)
-#define piglit_BeginTransformFeedback assert(!"glBeginTransformFeedback does not exist in ES2")
-#define piglit_BindBufferBase assert(!"glBindBufferBase does not exist in ES2")
-#define piglit_BindBufferRange assert(!"glBindBufferRange does not exist in ES2")
-#define piglit_EndTransformFeedback assert(!"glEndTransformFeedback does not exist in ES2")
-#define piglit_GetBooleani_v assert(!"glGetBooleani_v does not exist in ES2")
-#define piglit_GetIntegeri_v assert(!"glGetIntegeri_v does not exist in ES2")
-#define piglit_GetTransformFeedbackVarying assert(!"glGetTransformFeedbackVarying does not exist in ES2")
-#define piglit_TransformFeedbackVaryings assert(!"glTransformFeedbackVaryings does not exist in ES2")
-#else
-extern PFNGLBEGINTRANSFORMFEEDBACKPROC piglit_BeginTransformFeedback;
-extern PFNGLBINDBUFFERBASEPROC piglit_BindBufferBase;
-extern PFNGLBINDBUFFERRANGEPROC piglit_BindBufferRange;
-extern PFNGLENDTRANSFORMFEEDBACKPROC piglit_EndTransformFeedback;
-extern PFNGLGETBOOLEANI_VPROC piglit_GetBooleani_v;
-extern PFNGLGETINTEGERI_VPROC piglit_GetIntegeri_v;
-extern PFNGLGETTRANSFORMFEEDBACKVARYINGPROC piglit_GetTransformFeedbackVarying;
-extern PFNGLTRANSFORMFEEDBACKVARYINGSPROC piglit_TransformFeedbackVaryings;
-#endif
-/*@}*/
-
-/**
  * Require transform feedback.
  *
  * Transform feedback may either be provided by GL 3.0 or
-- 
1.7.7.6



More information about the Piglit mailing list