st: Remove struct st_api, st_gl_api_create and st_gl_api.h
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:
@@ -50,7 +50,6 @@ dri_create_context(gl_api api, const struct gl_config * visual,
|
||||
{
|
||||
__DRIscreen *sPriv = cPriv->driScreenPriv;
|
||||
struct dri_screen *screen = dri_screen(sPriv);
|
||||
struct st_api *stapi = screen->st_api;
|
||||
struct dri_context *ctx = NULL;
|
||||
struct st_context_iface *st_share = NULL;
|
||||
struct st_context_attribs attribs;
|
||||
@@ -195,7 +194,6 @@ dri_create_context(gl_api api, const struct gl_config * visual,
|
||||
goto fail;
|
||||
}
|
||||
ctx->st->st_manager_private = (void *) ctx;
|
||||
ctx->stapi = stapi;
|
||||
|
||||
if (ctx->st->cso_context) {
|
||||
ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context,
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
|
||||
struct pipe_context;
|
||||
struct pipe_fence;
|
||||
struct st_api;
|
||||
struct st_context_iface;
|
||||
struct dri_drawable;
|
||||
|
||||
@@ -57,7 +56,6 @@ struct dri_context
|
||||
bool is_shared_buffer_bound;
|
||||
|
||||
/* gallium */
|
||||
struct st_api *stapi;
|
||||
struct st_context_iface *st;
|
||||
struct pp_queue_t *pp;
|
||||
struct hud_context *hud;
|
||||
|
||||
@@ -37,7 +37,6 @@
|
||||
#include "pipe/p_screen.h"
|
||||
#include "pipe/p_format.h"
|
||||
#include "pipe-loader/pipe_loader.h"
|
||||
#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
|
||||
#include "frontend/drm_driver.h"
|
||||
|
||||
#include "util/u_debug.h"
|
||||
@@ -837,10 +836,6 @@ dri_init_screen_helper(struct dri_screen *screen,
|
||||
if (screen->validate_egl_image)
|
||||
screen->base.validate_egl_image = dri_validate_egl_image;
|
||||
|
||||
screen->st_api = st_gl_api_create();
|
||||
if (!screen->st_api)
|
||||
return NULL;
|
||||
|
||||
if(pscreen->get_param(pscreen, PIPE_CAP_NPOT_TEXTURES))
|
||||
screen->target = PIPE_TEXTURE_2D;
|
||||
else
|
||||
|
||||
@@ -51,7 +51,6 @@ struct dri_screen
|
||||
{
|
||||
/* st_api */
|
||||
struct st_manager base;
|
||||
struct st_api *st_api;
|
||||
|
||||
/* dri */
|
||||
__DRIscreen *sPriv;
|
||||
|
||||
@@ -82,7 +82,6 @@
|
||||
* global.
|
||||
*/
|
||||
static struct xm_driver driver;
|
||||
static struct st_api *stapi;
|
||||
|
||||
/* Default strict invalidate to false. This means we will not call
|
||||
* XGetGeometry after every swapbuffers, which allows swapbuffers to
|
||||
@@ -109,7 +108,6 @@ boolean xmesa_strict_invalidate = FALSE;
|
||||
void xmesa_set_driver( const struct xm_driver *templ )
|
||||
{
|
||||
driver = *templ;
|
||||
stapi = driver.create_st_api();
|
||||
|
||||
xmesa_strict_invalidate =
|
||||
debug_get_bool_option("XMESA_STRICT_INVALIDATE", FALSE);
|
||||
|
||||
@@ -32,13 +32,11 @@
|
||||
#include <X11/Xlib.h>
|
||||
|
||||
struct pipe_screen;
|
||||
struct st_api;
|
||||
|
||||
/* This is the driver interface required by the glx/xlib frontends.
|
||||
*/
|
||||
struct xm_driver {
|
||||
struct pipe_screen *(*create_pipe_screen)( Display *display );
|
||||
struct st_api *(*create_st_api)( void );
|
||||
};
|
||||
|
||||
extern void
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
#include "util/format/u_format.h"
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
|
||||
|
||||
#include "GLView.h"
|
||||
|
||||
@@ -342,7 +341,6 @@ hgl_create_display(struct pipe_screen* screen)
|
||||
|
||||
display = CALLOC_STRUCT(hgl_display);
|
||||
assert(display);
|
||||
display->api = st_gl_api_create();
|
||||
display->manager = CALLOC_STRUCT(st_manager);
|
||||
assert(display->manager);
|
||||
display->manager->screen = screen;
|
||||
|
||||
@@ -52,7 +52,6 @@ struct hgl_display
|
||||
{
|
||||
mtx_t mutex;
|
||||
|
||||
struct st_api* api;
|
||||
struct st_manager* manager;
|
||||
};
|
||||
|
||||
|
||||
@@ -70,7 +70,6 @@
|
||||
#include "postprocess/postprocess.h"
|
||||
|
||||
#include "frontend/api.h"
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
|
||||
|
||||
|
||||
@@ -132,7 +131,6 @@ osmesa_st_get_param(struct st_manager *smapi, enum st_manager_param param)
|
||||
}
|
||||
|
||||
static struct st_manager *stmgr = NULL;
|
||||
static struct st_api *stapi = NULL;
|
||||
|
||||
static void
|
||||
destroy_st_manager(void)
|
||||
@@ -156,8 +154,6 @@ create_st_manager(void)
|
||||
stmgr->get_param = osmesa_st_get_param;
|
||||
stmgr->get_egl_image = NULL;
|
||||
}
|
||||
|
||||
stapi = st_gl_api_create();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -140,9 +140,8 @@ stw_init(const struct stw_winsys *stw_winsys)
|
||||
|
||||
stw_dev->stw_winsys = stw_winsys;
|
||||
|
||||
stw_dev->stapi = stw_st_create_api();
|
||||
stw_dev->smapi = CALLOC_STRUCT(st_manager);
|
||||
if (!stw_dev->stapi || !stw_dev->smapi)
|
||||
if (!stw_dev->smapi)
|
||||
goto error1;
|
||||
|
||||
stw_dev->smapi->get_param = stw_get_param;
|
||||
|
||||
@@ -43,7 +43,6 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
struct pipe_screen;
|
||||
struct st_api;
|
||||
struct st_manager;
|
||||
struct stw_framebuffer;
|
||||
|
||||
@@ -58,7 +57,6 @@ struct stw_device
|
||||
/* Cache some PIPE_CAP_* */
|
||||
unsigned max_2d_length;
|
||||
|
||||
struct st_api *stapi;
|
||||
struct st_manager *smapi;
|
||||
|
||||
LUID AdapterLuid;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
#include "util/u_memory.h"
|
||||
#include "util/u_inlines.h"
|
||||
#include "util/u_atomic.h"
|
||||
#include "state_tracker/st_gl_api.h" /* for st_gl_api_create */
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
#include "stw_st.h"
|
||||
@@ -592,13 +591,3 @@ stw_get_framebuffer_resource(struct st_framebuffer_iface *stfb,
|
||||
struct stw_st_framebuffer *stwfb = stw_st_framebuffer(stfb);
|
||||
return stwfb->textures[att];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create an st_api of the gallium frontend.
|
||||
*/
|
||||
struct st_api *
|
||||
stw_st_create_api(void)
|
||||
{
|
||||
return st_gl_api_create();
|
||||
}
|
||||
|
||||
@@ -37,9 +37,6 @@ struct stw_framebuffer;
|
||||
bool
|
||||
stw_own_mutex(const CRITICAL_SECTION *cs);
|
||||
|
||||
struct st_api *
|
||||
stw_st_create_api(void);
|
||||
|
||||
struct st_framebuffer_iface *
|
||||
stw_st_create_framebuffer(struct stw_framebuffer *fb, struct st_manager *smapi);
|
||||
|
||||
|
||||
@@ -501,17 +501,10 @@ struct st_manager
|
||||
};
|
||||
|
||||
/**
|
||||
* Represent the OpenGL rendering API.
|
||||
* The following st_api_* functions represent the OpenGL rendering API.
|
||||
*
|
||||
* Implemented by the gallium frontend and used by the frontend manager.
|
||||
*/
|
||||
struct st_api
|
||||
{
|
||||
/**
|
||||
* The name of the rendering API. This is informative.
|
||||
*/
|
||||
const char *name;
|
||||
};
|
||||
|
||||
/**
|
||||
* Query supported OpenGL versions. (if applicable)
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
//#include "state_tracker/st_cb_fbo.h"
|
||||
//#include "state_tracker/st_cb_flush.h"
|
||||
#include "state_tracker/st_context.h"
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
#include "frontend/sw_winsys.h"
|
||||
#include "sw/hgl/hgl_sw_winsys.h"
|
||||
#include "util/u_atomic.h"
|
||||
|
||||
@@ -35,7 +35,6 @@
|
||||
#include "sw/xlib/xlib_sw_winsys.h"
|
||||
#include "xm_public.h"
|
||||
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
#include "target-helpers/inline_sw_helper.h"
|
||||
#include "target-helpers/inline_debug_helper.h"
|
||||
|
||||
@@ -78,7 +77,6 @@ fail:
|
||||
static struct xm_driver xlib_driver =
|
||||
{
|
||||
.create_pipe_screen = swrast_xlib_create_screen,
|
||||
.create_st_api = st_gl_api_create,
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -354,7 +354,6 @@ files_libmesa = files(
|
||||
'state_tracker/st_format.h',
|
||||
'state_tracker/st_gen_mipmap.c',
|
||||
'state_tracker/st_gen_mipmap.h',
|
||||
'state_tracker/st_gl_api.h',
|
||||
'state_tracker/st_glsl_to_ir.cpp',
|
||||
'state_tracker/st_glsl_to_ir.h',
|
||||
'state_tracker/st_glsl_to_nir.cpp',
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
|
||||
#ifndef ST_GL_API_H
|
||||
#define ST_GL_API_H
|
||||
|
||||
struct st_api *st_gl_api_create(void);
|
||||
|
||||
#endif
|
||||
@@ -52,8 +52,6 @@
|
||||
#include "st_sampler_view.h"
|
||||
#include "st_util.h"
|
||||
|
||||
#include "state_tracker/st_gl_api.h"
|
||||
|
||||
#include "pipe/p_context.h"
|
||||
#include "pipe/p_screen.h"
|
||||
#include "util/format/u_format.h"
|
||||
@@ -1449,17 +1447,6 @@ st_api_query_versions(struct st_manager *sm,
|
||||
}
|
||||
|
||||
|
||||
static const struct st_api st_gl_api = {
|
||||
.name = "Mesa " PACKAGE_VERSION,
|
||||
};
|
||||
|
||||
|
||||
struct st_api *
|
||||
st_gl_api_create(void)
|
||||
{
|
||||
return (struct st_api *) &st_gl_api;
|
||||
}
|
||||
|
||||
void
|
||||
st_manager_invalidate_drawables(struct gl_context *ctx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user