diff options
author | marha <marha@users.sourceforge.net> | 2012-08-16 14:48:54 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-08-16 14:48:54 +0200 |
commit | 4aac32998c2b173b84aec0b020aa086fef4b1423 (patch) | |
tree | 3ffcb971bcc2f01929f60f8f704996544b69b2e1 /mesalib/src/mesa/drivers/dri | |
parent | 9ddf44af81782451cee798e06749ce3067a14a41 (diff) | |
download | vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.gz vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.tar.bz2 vcxsrv-4aac32998c2b173b84aec0b020aa086fef4b1423.zip |
libxcb xserver mesa git update 16 Aug 2012
Diffstat (limited to 'mesalib/src/mesa/drivers/dri')
-rw-r--r-- | mesalib/src/mesa/drivers/dri/common/dri_util.c | 20 | ||||
-rw-r--r-- | mesalib/src/mesa/drivers/dri/swrast/swrast.c | 19 |
2 files changed, 32 insertions, 7 deletions
diff --git a/mesalib/src/mesa/drivers/dri/common/dri_util.c b/mesalib/src/mesa/drivers/dri/common/dri_util.c index 91ae186fe..86409dd06 100644 --- a/mesalib/src/mesa/drivers/dri/common/dri_util.c +++ b/mesalib/src/mesa/drivers/dri/common/dri_util.c @@ -192,6 +192,8 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, mesa_api = API_OPENGLES2; break; case __DRI_API_OPENGL_CORE: + mesa_api = API_OPENGL_CORE; + break; default: *error = __DRI_CTX_ERROR_BAD_API; return NULL; @@ -218,6 +220,20 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, } } + /* Mesa does not support the GL_ARB_compatibilty extension or the + * compatibility profile. This means that we treat a API_OPENGL 3.1 as + * API_OPENGL_CORE and reject API_OPENGL 3.2+. + */ + if (mesa_api == API_OPENGL && major_version == 3 && minor_version == 1) + mesa_api = API_OPENGL_CORE; + + if (mesa_api == API_OPENGL + && ((major_version > 3) + || (major_version == 3 && minor_version >= 2))) { + *error = __DRI_CTX_ERROR_BAD_API; + return NULL; + } + /* The EGL_KHR_create_context spec says: * * "Flags are only defined for OpenGL context creation, and specifying @@ -228,8 +244,8 @@ dri2CreateContextAttribs(__DRIscreen *screen, int api, * anything specific about this case. However, none of the known flags * have any meaning in an ES context, so this seems safe. */ - if (mesa_api != __DRI_API_OPENGL - && mesa_api != __DRI_API_OPENGL_CORE + if (mesa_api != API_OPENGL + && mesa_api != API_OPENGL_CORE && flags != 0) { *error = __DRI_CTX_ERROR_BAD_FLAG; return NULL; diff --git a/mesalib/src/mesa/drivers/dri/swrast/swrast.c b/mesalib/src/mesa/drivers/dri/swrast/swrast.c index ca6bda027..7773fd905 100644 --- a/mesalib/src/mesa/drivers/dri/swrast/swrast.c +++ b/mesalib/src/mesa/drivers/dri/swrast/swrast.c @@ -719,11 +719,20 @@ dri_create_context(gl_api api, */ (void) flags; - if (api == API_OPENGL - && (major_version > 2 - || (major_version == 2 && minor_version > 1))) { - *error = __DRI_CTX_ERROR_BAD_VERSION; - goto context_fail; + switch (api) { + case API_OPENGL: + if (major_version > 2 + || (major_version == 2 && minor_version > 1)) { + *error = __DRI_CTX_ERROR_BAD_VERSION; + return GL_FALSE; + } + break; + case API_OPENGLES: + case API_OPENGLES2: + break; + case API_OPENGL_CORE: + *error = __DRI_CTX_ERROR_BAD_API; + return GL_FALSE; } ctx = CALLOC_STRUCT(dri_context); |