diff options
author | Eric Anholt <[email protected]> | 2013-09-26 12:01:56 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-10-10 16:34:30 -0700 |
commit | 083f66fdd6451648fe355b64b02b29a6a4389f0d (patch) | |
tree | 7965c2cd9f5b2f96ea1268ef6640d6e39ed55bff /src/mesa/drivers/dri/swrast | |
parent | d81632fb1e809a0b1ee9310ae3a4733a1c0651b7 (diff) |
dri: Move API version validation into dri/common.
i965, i915, radeon, r200, swrast, and nouveau were mostly trying to do the
same logic, except where they failed to. Notably, swrast had code that
appeared to try to enable GLES1/2 but forgot to set api_mask (thus
preventing any gles context from being created), and the non-intel drivers
didn't support MESA_GL_VERSION_OVERRIDE.
nouveau still relies on _mesa_compute_version(), because I don't know what
its limits actually are, and gallium drivers don't declare limits up front
at all. I think I've heard talk about doing so, though.
v2: Compat max version should be 30 (noted by Ken)
Drop r100's custom max version check, too (noted by Emil Velikov)
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/swrast')
-rw-r--r-- | src/mesa/drivers/dri/swrast/swrast.c | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 332c7b72fd3..4725a7f42dd 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -200,6 +200,10 @@ dri_init_screen(__DRIscreen * psp) TRACE; + psp->max_gl_compat_version = 21; + psp->max_gl_es1_version = 11; + psp->max_gl_es2_version = 20; + psp->extensions = dri_screen_extensions; configs16 = swrastFillInModes(psp, 16, 16, 0, 1); @@ -674,22 +678,6 @@ dri_create_context(gl_api api, */ (void) flags; - switch (api) { - case API_OPENGL_COMPAT: - 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); if (ctx == NULL) { *error = __DRI_CTX_ERROR_NO_MEMORY; |