[Piglit] [PATCH 5/6] util: add a way to query if the profile is Core

Marek Olšák maraeo at gmail.com
Sat Jul 20 11:29:44 PDT 2013


---
 tests/util/piglit-framework-gl/piglit_wfl_framework.c | 4 +++-
 tests/util/piglit-util-gl-common.c                    | 2 ++
 tests/util/piglit-util-gl-common.h                    | 2 ++
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
index 419eb75..d8cb944 100644
--- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c
@@ -401,8 +401,10 @@ make_context_current(struct piglit_wfl_framework *wfl_fw,
 		ok = make_context_current_singlepass(wfl_fw, test_config,
 		                                     CONTEXT_GL_CORE,
 		                                     partial_config_attrib_list);
-		if (ok)
+		if (ok) {
+			piglit_is_core_profile = true;
 			return;
+		}
 
 		printf("piglit: info: Failed to create GL %d.%d "
 		       "core context\n",
diff --git a/tests/util/piglit-util-gl-common.c b/tests/util/piglit-util-gl-common.c
index 29538bd..7d21d18 100644
--- a/tests/util/piglit-util-gl-common.c
+++ b/tests/util/piglit-util-gl-common.c
@@ -34,6 +34,8 @@
  */
 static const char **gl_extensions = NULL;
 
+bool piglit_is_core_profile;
+
 bool piglit_is_gles(void)
 {
 	const char *version_string = (const char *) glGetString(GL_VERSION);
diff --git a/tests/util/piglit-util-gl-common.h b/tests/util/piglit-util-gl-common.h
index aa21391..41f110a 100644
--- a/tests/util/piglit-util-gl-common.h
+++ b/tests/util/piglit-util-gl-common.h
@@ -43,6 +43,8 @@ extern const uint8_t fdo_bitmap[];
 extern const unsigned int fdo_bitmap_width;
 extern const unsigned int fdo_bitmap_height;
 
+extern bool piglit_is_core_profile;
+
 /**
  * Determine if the API is OpenGL ES.
  */
-- 
1.8.1.2



More information about the Piglit mailing list