diff options
author | Jose Fonseca <jfonseca@vmware.com> | 2015-03-14 07:16:19 +0000 |
---|---|---|
committer | Jose Fonseca <jfonseca@vmware.com> | 2015-03-17 12:13:33 +0000 |
commit | 1a007e5035898660524100e2d49f1ead7f0a3233 (patch) | |
tree | 73910c109391a6de75b0a5550af5ae1db944d581 /tests/util | |
parent | d56094423d438c84e0004e43dbbf021fa5446072 (diff) |
framework: Request forward-compatible contexts when supports_gl_core_version == 31.
Core profiles can only be requested for 3.2 contexts and above. For 3.1
contexts, the closest thing to a 3.1 core profile is a 3.1 context
without GL_ARB_compatibility.
Requesting a forward compatible context should gives precisely that.
The OpenGL 3.1 specification, section E, "The Deprecation Model" states
"Forward compatible contexts cannot restore deprecated functionality
through extensions"
hence, if my interpretation is correct, a forward-compatible context
must not advertise ARB_compatibility.
Therefore requesting a forward-compatible context should eliminate the
need to falling back to creating a 3.2 core context in
special_case_gl31() with Waffle framework. And will help with GLUT,
where we don't even have the logic to retry with 3.2 context -- and just
use whatever 3.1 context we get (shouldn't cause problems with Mesa
which never advertises ARB_compatibility, but it might cause false
negatives with other implementations.).
But truth is, the main drive for this change is thus: we are considering
to update Mesa to never return non-forward-compaible 3.1 contexts on
Windows, because many Windows applications never bother to check whether
the created 3.1 context advertises ARB_compatibility or not. So we
either set forward compatible flag for 3.1 contexts or have logic to
always retry 3.2 contexts, or tests that specifically want 3.1 contexts
will just skip with Mesa on Windows.
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/piglit-framework-gl/piglit_glut_framework.c | 17 | ||||
-rw-r--r-- | tests/util/piglit-framework-gl/piglit_wfl_framework.c | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/tests/util/piglit-framework-gl/piglit_glut_framework.c b/tests/util/piglit-framework-gl/piglit_glut_framework.c index 4651937d0..6ce187201 100644 --- a/tests/util/piglit-framework-gl/piglit_glut_framework.c +++ b/tests/util/piglit-framework-gl/piglit_glut_framework.c @@ -147,6 +147,23 @@ init_glut(void) glutInitContextProfile(GLUT_COMPATIBILITY_PROFILE); } } + + int context_flags = 0; + /* There are no 3.1 core profiles -- the closest is 3.1 context without + * ARB_compatibility or a 3.2 core context --, and setting + * forward-compatible flag should ensure we don't get a 3.1 context w/ + * ARB_compatibility. + */ + if (test_config->require_forward_compatible_context || + test_config->supports_gl_core_version == 31) { + context_flags |= GLUT_FORWARD_COMPATIBLE; + } + if (test_config->require_debug_context) { + context_flags |= GLUT_DEBUG; + } + if (context_flags) { + glutInitContextFlags(context_flags); + } #endif glut_fw.window = glutCreateWindow("Piglit"); diff --git a/tests/util/piglit-framework-gl/piglit_wfl_framework.c b/tests/util/piglit-framework-gl/piglit_wfl_framework.c index cf7d2da8d..faf758b27 100644 --- a/tests/util/piglit-framework-gl/piglit_wfl_framework.c +++ b/tests/util/piglit-framework-gl/piglit_wfl_framework.c @@ -342,7 +342,14 @@ make_config_attrib_list(const struct piglit_gl_test_config *test_config, break; } - if (test_config->require_forward_compatible_context) { + /* There are no 3.1 core profiles -- the closest is 3.1 context without + * ARB_compatibility or a 3.2 core context --, and setting + * forward-compatible flag should ensure we don't get a 3.1 context w/ + * ARB_compatibility. + */ + if (test_config->require_forward_compatible_context || + (flavor == CONTEXT_GL_CORE && + test_config->supports_gl_core_version == 31)) { head_attrib_list[i++] = WAFFLE_CONTEXT_FORWARD_COMPATIBLE; head_attrib_list[i++] = true; } |