st: Turn st_api::create_context to be direct accessed function st_api_create_context
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Jesse Natalie <jenatali@microsoft.com> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19197>
This commit is contained in:
@@ -166,7 +166,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
|
||||
|
||||
attribs.options = screen->options;
|
||||
dri_fill_st_visual(&attribs.visual, screen, visual);
|
||||
ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
|
||||
ctx->st = st_api_create_context(&screen->base, &attribs, &ctx_err,
|
||||
st_share);
|
||||
if (ctx->st == NULL) {
|
||||
switch (ctx_err) {
|
||||
|
||||
@@ -1014,7 +1014,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list,
|
||||
goto no_st;
|
||||
}
|
||||
|
||||
c->st = stapi->create_context(stapi, xmdpy->smapi, &attribs,
|
||||
c->st = st_api_create_context(xmdpy->smapi, &attribs,
|
||||
&ctx_err, (share_list) ? share_list->st : NULL);
|
||||
if (c->st == NULL)
|
||||
goto no_st;
|
||||
|
||||
@@ -173,16 +173,6 @@ get_st_manager(void)
|
||||
return stmgr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create/return singleton st_api object.
|
||||
*/
|
||||
static struct st_api *
|
||||
get_st_api(void)
|
||||
{
|
||||
get_st_manager();
|
||||
return stapi;
|
||||
}
|
||||
|
||||
/* Reads the color or depth buffer from the backing context to either the user storage
|
||||
* (color buffer) or our temporary (z/s)
|
||||
*/
|
||||
@@ -583,7 +573,6 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
|
||||
struct st_context_iface *st_shared;
|
||||
enum st_context_error st_error = 0;
|
||||
struct st_context_attribs attribs;
|
||||
struct st_api *stapi = get_st_api();
|
||||
GLenum format = GL_RGBA;
|
||||
int depthBits = 0, stencilBits = 0, accumBits = 0;
|
||||
int profile = OSMESA_COMPAT_PROFILE, version_major = 1, version_minor = 0;
|
||||
@@ -694,7 +683,7 @@ OSMesaCreateContextAttribs(const int *attribList, OSMesaContext sharelist)
|
||||
osmesa->depth_stencil_format,
|
||||
osmesa->accum_format);
|
||||
|
||||
osmesa->stctx = stapi->create_context(stapi, get_st_manager(),
|
||||
osmesa->stctx = st_api_create_context(get_st_manager(),
|
||||
&attribs, &st_error, st_shared);
|
||||
if (!osmesa->stctx) {
|
||||
FREE(osmesa);
|
||||
|
||||
@@ -241,7 +241,7 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, struct stw_context *shareCt
|
||||
|
||||
attribs.options = stw_dev->st_options;
|
||||
|
||||
ctx->st = stw_dev->stapi->create_context(stw_dev->stapi,
|
||||
ctx->st = st_api_create_context(
|
||||
smapi, &attribs, &ctx_err, shareCtx ? shareCtx->st : NULL);
|
||||
if (ctx->st == NULL)
|
||||
goto no_st_ctx;
|
||||
|
||||
@@ -522,17 +522,17 @@ struct st_api
|
||||
int *gl_compat_version,
|
||||
int *gl_es1_version,
|
||||
int *gl_es2_version);
|
||||
|
||||
/**
|
||||
* Create a rendering context.
|
||||
*/
|
||||
struct st_context_iface *(*create_context)(struct st_api *stapi,
|
||||
struct st_manager *smapi,
|
||||
const struct st_context_attribs *attribs,
|
||||
enum st_context_error *error,
|
||||
struct st_context_iface *stsharei);
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a rendering context.
|
||||
*/
|
||||
struct st_context_iface *
|
||||
st_api_create_context(struct st_manager *smapi,
|
||||
const struct st_context_attribs *attribs,
|
||||
enum st_context_error *error,
|
||||
struct st_context_iface *stsharei);
|
||||
|
||||
/**
|
||||
* Bind the context to the calling thread with draw and read as drawables.
|
||||
*
|
||||
|
||||
@@ -179,7 +179,7 @@ GalliumContext::CreateContext(HGLWinsysContext *wsContext)
|
||||
|
||||
// Create context using state tracker api call
|
||||
enum st_context_error result;
|
||||
context->st = fDisplay->api->create_context(fDisplay->api, fDisplay->manager,
|
||||
context->st = st_api_create_context(fDisplay->manager,
|
||||
&attribs, &result, shared);
|
||||
|
||||
if (!context->st) {
|
||||
|
||||
@@ -1004,8 +1004,8 @@ st_manager_destroy(struct st_manager *smapi)
|
||||
}
|
||||
|
||||
|
||||
static struct st_context_iface *
|
||||
st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
|
||||
struct st_context_iface *
|
||||
st_api_create_context(struct st_manager *smapi,
|
||||
const struct st_context_attribs *attribs,
|
||||
enum st_context_error *error,
|
||||
struct st_context_iface *shared_stctxi)
|
||||
@@ -1452,7 +1452,6 @@ st_api_query_versions(struct st_api *stapi, struct st_manager *sm,
|
||||
static const struct st_api st_gl_api = {
|
||||
.name = "Mesa " PACKAGE_VERSION,
|
||||
.query_versions = st_api_query_versions,
|
||||
.create_context = st_api_create_context,
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user