mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 16:08:04 +02:00
dri: Use the right type for the API token
Pass mesa_api to CreateContext, and abort early if the requested API isn't recognized.
This commit is contained in:
parent
28c790ab31
commit
1b8c9fef11
1 changed files with 3 additions and 1 deletions
|
|
@ -651,6 +651,8 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
|
|||
case __DRI_API_GLES2:
|
||||
mesa_api = API_OPENGLES2;
|
||||
break;
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
|
||||
context = malloc(sizeof *context);
|
||||
|
|
@ -661,7 +663,7 @@ dri2CreateNewContextForAPI(__DRIscreen *screen, int api,
|
|||
context->driDrawablePriv = NULL;
|
||||
context->loaderPrivate = data;
|
||||
|
||||
if (!(*screen->DriverAPI.CreateContext)(api, &config->modes,
|
||||
if (!(*screen->DriverAPI.CreateContext)(mesa_api, &config->modes,
|
||||
context, shareCtx) ) {
|
||||
free(context);
|
||||
return NULL;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue