diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2023-05-16 18:46:50 -0700 |
---|---|---|
committer | Marge Bot <emma+marge@anholt.net> | 2023-05-18 01:25:29 +0000 |
commit | 8bb1ecaa02177720758255bdd7ec34a5d15feca4 (patch) | |
tree | 881dcac05d6041019146840bd1544d81fd747f51 | |
parent | f9688f637884a8f041ca17e857d664abe4a924b8 (diff) | |
download | mesa-main.tar.gz |
Fixes: adbe8b6c17a ("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>
-rw-r--r-- | src/mesa/main/context.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index d8eea2ea867..2b810b0d863 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -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; |