mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
mesa/main: Exit early when trying to create an unsupported context API
Fixes: adbe8b6c17 ("mesa: optimize out _mesa_is_desktop_gl*() and _mesa_is_gles*() calls when not built")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9038
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23068>
This commit is contained in:
parent
f9688f6378
commit
8bb1ecaa02
1 changed files with 18 additions and 0 deletions
|
|
@ -996,6 +996,24 @@ _mesa_initialize_context(struct gl_context *ctx,
|
|||
struct gl_shared_state *shared;
|
||||
int i;
|
||||
|
||||
switch (api) {
|
||||
case API_OPENGL_COMPAT:
|
||||
case API_OPENGL_CORE:
|
||||
if (!HAVE_OPENGL)
|
||||
return GL_FALSE;
|
||||
break;
|
||||
case API_OPENGLES2:
|
||||
if (!HAVE_OPENGL_ES_2)
|
||||
return GL_FALSE;
|
||||
break;
|
||||
case API_OPENGLES:
|
||||
if (!HAVE_OPENGL_ES_1)
|
||||
return GL_FALSE;
|
||||
break;
|
||||
default:
|
||||
return GL_FALSE;
|
||||
}
|
||||
|
||||
ctx->API = api;
|
||||
ctx->DrawBuffer = NULL;
|
||||
ctx->ReadBuffer = NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue