gallium: move st function declarations from api.h into st_context.h

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20027>
This commit is contained in:
Marek Olšák 2022-11-27 14:40:28 -05:00 committed by Marge Bot
parent be8f1d685e
commit 0122a67c81
3 changed files with 41 additions and 51 deletions

View file

@ -406,55 +406,4 @@ struct pipe_frontend_screen
void *st_manager_private;
};
/**
* The following st_api_* functions represent the OpenGL rendering API.
*
* Implemented by the gallium frontend and used by the frontend manager.
*/
/**
* Query supported OpenGL versions. (if applicable)
* The format is (major*10+minor).
*/
void
st_api_query_versions(struct pipe_frontend_screen *fscreen,
struct st_config_options *options,
int *gl_core_version,
int *gl_compat_version,
int *gl_es1_version,
int *gl_es2_version);
/**
* Create a rendering context.
*/
struct st_context *
st_api_create_context(struct pipe_frontend_screen *fscreen,
const struct st_context_attribs *attribs,
enum st_context_error *error,
struct st_context *shared_ctx);
/**
* Bind the context to the calling thread with draw and read as drawables.
*
* The framebuffers might be NULL, or might have different visuals than the
* context does.
*/
bool
st_api_make_current(struct st_context *st,
struct st_framebuffer_iface *stdrawi,
struct st_framebuffer_iface *streadi);
/**
* Get the currently bound context in the calling thread.
*/
struct st_context *
st_api_get_current(void);
/**
* Notify the st manager the framebuffer interface object
* is no longer valid.
*/
void
st_api_destroy_drawable(struct st_framebuffer_iface *stfbi);
#endif /* _API_H_ */

View file

@ -453,6 +453,32 @@ st_get_nir_compiler_options(struct st_context *st, gl_shader_stage stage);
void st_invalidate_state(struct gl_context *ctx);
void st_set_background_context(struct gl_context *ctx,
struct util_queue_monitoring *queue_info);
void
st_api_query_versions(struct pipe_frontend_screen *fscreen,
struct st_config_options *options,
int *gl_core_version,
int *gl_compat_version,
int *gl_es1_version,
int *gl_es2_version);
struct st_context *
st_api_create_context(struct pipe_frontend_screen *fscreen,
const struct st_context_attribs *attribs,
enum st_context_error *error,
struct st_context *shared_ctx);
bool
st_api_make_current(struct st_context *st,
struct st_framebuffer_iface *stdrawi,
struct st_framebuffer_iface *streadi);
struct st_context *
st_api_get_current(void);
void
st_api_destroy_drawable(struct st_framebuffer_iface *stfbi);
#ifdef __cplusplus
}
#endif

View file

@ -931,6 +931,9 @@ st_manager_destroy(struct pipe_frontend_screen *fscreen)
}
/**
* Create a rendering context.
*/
struct st_context *
st_api_create_context(struct pipe_frontend_screen *fscreen,
const struct st_context_attribs *attribs,
@ -1071,6 +1074,9 @@ st_api_create_context(struct pipe_frontend_screen *fscreen,
}
/**
* Get the currently bound context in the calling thread.
*/
struct st_context *
st_api_get_current(void)
{
@ -1124,6 +1130,11 @@ st_framebuffer_reuse_or_create(struct st_context *st,
}
/**
* Bind the context to the calling thread with draw and read as drawables.
*
* The framebuffers might be NULL, meaning the context is surfaceless.
*/
bool
st_api_make_current(struct st_context *st,
struct st_framebuffer_iface *stdrawi,
@ -1350,6 +1361,10 @@ get_version(struct pipe_screen *screen,
}
/**
* Query supported OpenGL versions. (if applicable)
* The format is (major*10+minor).
*/
void
st_api_query_versions(struct pipe_frontend_screen *fscreen,
struct st_config_options *options,