diff options
author | Rico Schüller <[email protected]> | 2013-09-01 21:30:19 +0200 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2013-09-04 16:07:21 -0700 |
commit | 8b302e1635534bfc6ed3ad671f2428470b3a765d (patch) | |
tree | e04e372080e468ad90bbb4d22528ec1507da3af3 /src/glx/dri_common.c | |
parent | 4e861ac4a1f1bdbd28f66e3f15eb45aa45a47bad (diff) |
glx: Initialize OpenGL version to 1.0
The old code in dri2_glx suffered from a typographical error that caused
the default version to be 2.1 instead of 1.2 (minimum required by the
Linux OpenGL ABI). drisw_glx had a similar error resulting in a default
version of 0.1.
Some driver/card combinations (r200/RV280, i915/915G) don't support
OpenGL 2.1. These create in some corner cases an indirect context
instead of a direct context when calling glXCreateContextAttribsARB().
This happens because of a bad default value. To avoid this, just used
the default value specified by the GLX_ARB_create_context specification:
"The default values for GLX_CONTEXT_MAJOR_VERSION_ARB and
GLX_CONTEXT_MINOR_VERSION_ARB are 1 and 0 respectively. In this
case, implementations will typically return the most recent version
of OpenGL they support which is backwards compatible with OpenGL 1.0
(e.g. 3.0, 3.1 + GL_ARB_compatibility, or 3.2 compatibility
profile)"
Refactor all the default value setting to dri2_convert_glx_attribs, and
make sure the correct defaults are set in that one place.
Signed-off-by: Rico Schüller <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Bugzilla http://bugs.winehq.org/show_bug.cgi?id=34238
Cc: "9.1 9.2" <[email protected]>
Diffstat (limited to 'src/glx/dri_common.c')
-rw-r--r-- | src/glx/dri_common.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c index b2a3117c5ac..5f199e9fde4 100644 --- a/src/glx/dri_common.c +++ b/src/glx/dri_common.c @@ -470,8 +470,14 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, bool got_profile = false; uint32_t profile; + *major_ver = 1; + *minor_ver = 0; + *render_type = GLX_RGBA_TYPE; + *reset = __DRI_CTX_RESET_NO_NOTIFICATION; + *flags = 0; + *api = __DRI_API_OPENGL; + if (num_attribs == 0) { - *api = __DRI_API_OPENGL; return true; } @@ -482,11 +488,6 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, return false; } - *major_ver = 1; - *minor_ver = 0; - *render_type = GLX_RGBA_TYPE; - *reset = __DRI_CTX_RESET_NO_NOTIFICATION; - for (i = 0; i < num_attribs; i++) { switch (attribs[i * 2]) { case GLX_CONTEXT_MAJOR_VERSION_ARB: @@ -526,7 +527,6 @@ dri2_convert_glx_attribs(unsigned num_attribs, const uint32_t *attribs, } } - *api = __DRI_API_OPENGL; if (!got_profile) { if (*major_ver > 3 || (*major_ver == 3 && *minor_ver >= 2)) *api = __DRI_API_OPENGL_CORE; |