gallium/stapi: move setting GL versions to the state tracker
All flags are set for st/mesa, so the state tracker doesn't have to check them. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
@@ -485,6 +485,16 @@ struct st_api
|
||||
*/
|
||||
void (*destroy)(struct st_api *stapi);
|
||||
|
||||
/**
|
||||
* Query supported OpenGL versions. (if applicable)
|
||||
* The format is (major*10+minor).
|
||||
*/
|
||||
void (*query_versions)(struct st_api *stapi, struct st_manager *sm,
|
||||
int *gl_core_version,
|
||||
int *gl_compat_version,
|
||||
int *gl_es1_version,
|
||||
int *gl_es2_version);
|
||||
|
||||
/**
|
||||
* Return an API entry point.
|
||||
*
|
||||
|
@@ -455,18 +455,11 @@ dri_init_screen_helper(struct dri_screen *screen,
|
||||
|
||||
dri_postprocessing_init(screen);
|
||||
|
||||
/* gallium drivers don't declare what version of GL they support, so we
|
||||
* check the computed Mesa context version after context creation and fail
|
||||
* out then.
|
||||
*/
|
||||
if (screen->st_api->profile_mask & ST_PROFILE_DEFAULT_MASK)
|
||||
screen->sPriv->max_gl_compat_version = 30;
|
||||
if (screen->st_api->profile_mask & ST_PROFILE_OPENGL_CORE_MASK)
|
||||
screen->sPriv->max_gl_core_version = 33;
|
||||
if (screen->st_api->profile_mask & ST_PROFILE_OPENGL_ES1_MASK)
|
||||
screen->sPriv->max_gl_es1_version = 11;
|
||||
if (screen->st_api->profile_mask & ST_PROFILE_OPENGL_ES2_MASK)
|
||||
screen->sPriv->max_gl_es2_version = 30;
|
||||
screen->st_api->query_versions(screen->st_api, &screen->base,
|
||||
&screen->sPriv->max_gl_core_version,
|
||||
&screen->sPriv->max_gl_compat_version,
|
||||
&screen->sPriv->max_gl_es1_version,
|
||||
&screen->sPriv->max_gl_es2_version);
|
||||
|
||||
return dri_fill_in_modes(screen);
|
||||
}
|
||||
|
@@ -369,12 +369,22 @@ vg_api_destroy(struct st_api *stapi)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vg_api_query_versions(struct st_api *stapi, struct st_manager *sm,
|
||||
int *gl_core_version,
|
||||
int *gl_compat_version,
|
||||
int *gl_es1_version,
|
||||
int *gl_es2_version)
|
||||
{
|
||||
}
|
||||
|
||||
static const struct st_api vg_api = {
|
||||
"Vega " PACKAGE_VERSION,
|
||||
ST_API_OPENVG,
|
||||
ST_PROFILE_DEFAULT_MASK,
|
||||
0,
|
||||
vg_api_destroy,
|
||||
vg_api_query_versions,
|
||||
vg_api_get_proc_address,
|
||||
vg_api_create_context,
|
||||
vg_api_make_current,
|
||||
|
@@ -910,6 +910,19 @@ st_manager_add_color_renderbuffer(struct st_context *st,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
st_api_query_versions(struct st_api *stapi, struct st_manager *sm,
|
||||
int *gl_core_version,
|
||||
int *gl_compat_version,
|
||||
int *gl_es1_version,
|
||||
int *gl_es2_version)
|
||||
{
|
||||
*gl_core_version = 33;
|
||||
*gl_compat_version = 30;
|
||||
*gl_es1_version = 11;
|
||||
*gl_es2_version = 30;
|
||||
}
|
||||
|
||||
static const struct st_api st_gl_api = {
|
||||
"Mesa " PACKAGE_VERSION,
|
||||
ST_API_OPENGL,
|
||||
@@ -920,6 +933,7 @@ static const struct st_api st_gl_api = {
|
||||
0,
|
||||
ST_API_FEATURE_MS_VISUALS_MASK,
|
||||
st_api_destroy,
|
||||
st_api_query_versions,
|
||||
st_api_get_proc_address,
|
||||
st_api_create_context,
|
||||
st_api_make_current,
|
||||
|
Reference in New Issue
Block a user