diff --git a/src/gallium/frontends/dri/dri_context.c b/src/gallium/frontends/dri/dri_context.c index 5e9c643c1e1..1e6120eeee3 100644 --- a/src/gallium/frontends/dri/dri_context.c +++ b/src/gallium/frontends/dri/dri_context.c @@ -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) { diff --git a/src/gallium/frontends/glx/xlib/xm_api.c b/src/gallium/frontends/glx/xlib/xm_api.c index 939cdb5a1cf..7e43ba2276e 100644 --- a/src/gallium/frontends/glx/xlib/xm_api.c +++ b/src/gallium/frontends/glx/xlib/xm_api.c @@ -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; diff --git a/src/gallium/frontends/osmesa/osmesa.c b/src/gallium/frontends/osmesa/osmesa.c index 6d52748604f..e9b4499f5c9 100644 --- a/src/gallium/frontends/osmesa/osmesa.c +++ b/src/gallium/frontends/osmesa/osmesa.c @@ -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); diff --git a/src/gallium/frontends/wgl/stw_context.c b/src/gallium/frontends/wgl/stw_context.c index b3a7bb13cd4..d7ae09135d6 100644 --- a/src/gallium/frontends/wgl/stw_context.c +++ b/src/gallium/frontends/wgl/stw_context.c @@ -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; diff --git a/src/gallium/include/frontend/api.h b/src/gallium/include/frontend/api.h index 6cb698428cb..51aa04b498a 100644 --- a/src/gallium/include/frontend/api.h +++ b/src/gallium/include/frontend/api.h @@ -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. * diff --git a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp index fe7c967a243..538355d4e2c 100644 --- a/src/gallium/targets/haiku-softpipe/GalliumContext.cpp +++ b/src/gallium/targets/haiku-softpipe/GalliumContext.cpp @@ -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) { diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index 69c73048a42..106785a293f 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -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, };