[Piglit] [PATCH v2 4/5] piglit-util-gl-common: Add Function to clear extensions list.

Kenney Phillis kphillisjr at gmail.com
Fri Aug 23 09:51:04 PDT 2013


The default handling of the extensions does not allow for proper
fall back of contexts to work as inteded. There is currently no
guarantee that any implementations of OpenGL will have the pointer
of supported extensions will remain constant after contexts change.
---
 tests/util/piglit-util-gl-common.c |    8 ++++++++
 tests/util/piglit-util-gl-common.h |    6 ++++++
 2 files changed, 14 insertions(+)

diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
index 7d21d18..336f0b0 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -132,6 +132,14 @@ static void initialize_piglit_extension_support(void)
 #endif
 }
 
+void piglit_reinitialize_extensions()
+{
+	if (gl_extensions != NULL) {
+		free(gl_extensions);
+		gl_extensions = NULL;
+	}
+}
+
 bool piglit_is_extension_supported(const char *name)
 {
 	initialize_piglit_extension_support();
diff --git a/tests/util/piglit-util-gl-common.h b/tests/util/piglit-util-gl-common.h
index 41f110a..ed18a4c 100644
--- a/tests/util/piglit-util-gl-common.h
+++ b/tests/util/piglit-util-gl-common.h
@@ -64,6 +64,12 @@ int piglit_get_gl_version(void);
 bool piglit_is_extension_supported(const char *name);
 
 /**
+ * reinitialize the supported extension List.
+ */
+
+void piglit_reinitialize_extensions();
+
+/**
  * \brief Convert a GL error to a string.
  *
  * For example, given GL_INVALID_ENUM, return "GL_INVALID_ENUM".
-- 
1.7.9.5



More information about the Piglit mailing list