summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/swrast
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2012-08-07 11:26:19 -0700
committerIan Romanick <[email protected]>2012-08-13 17:17:12 -0700
commit70f47505a2e5d4cf949b7c2650f3d9f6559bacb3 (patch)
treee68e75ad6891bf9faf3189deff29d189de704269 /src/mesa/drivers/dri/swrast
parent7e81f553bccda66fafa769f8456b4918d088181a (diff)
dri: Pass API_OPENGL_CORE through to the drivers
This forces the drivers to do at least some validation of context API and version before creating the context. In r100 and r200 drivers, this means that they don't do any post-hoc validation. v2: Actually reject compatibility profile 3.2+ contexts. Thanks Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/swrast')
-rw-r--r--src/mesa/drivers/dri/swrast/swrast.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index ca6bda02781..7773fd9050a 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/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);