util/framework/glut: check if we have a core profile

Submitted by Brian Paul on June 25, 2014, 3:45 p.m.

Details

Message ID 1403711134-23657-1-git-send-email-brianp@vmware.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Brian Paul June 25, 2014, 3:45 p.m.
For the GLUT framework, check the context version and whether
GL_ARB_compatibility is supported to determine if we should set
piglit_is_core_profile.  Fixes some issues when running GL 3.1 and
later on Windows.
---
 tests/util/piglit-framework-gl/piglit_glut_framework.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Patch hide | download patch | download mbox

diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c
index 7c872fb..7530d8d 100644
--- a/tests/util/piglit-framework-gl/piglit_glut_framework.c
+++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c
@@ -256,6 +256,14 @@  piglit_glut_framework_create(const struct piglit_gl_test_config *test_config)
 	if (!check_gl_version(test_config))
 		piglit_report_result(PIGLIT_SKIP);
 
+        /* Check if we actually have a core profile */
+	{
+		int actual_version = piglit_get_gl_version();
+		if (actual_version >= 31 &&
+		    !piglit_is_extension_supported("GL_ARB_compatibility"))
+			piglit_is_core_profile = true;
+	}
+
 	glut_fw.gl_fw.swap_buffers = swap_buffers;
 	glut_fw.gl_fw.run_test = run_test;
 	glut_fw.gl_fw.post_redisplay = post_redisplay;