mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 20:38:06 +02:00
gallium/pp: don't use st_context_iface, use an explicit callback
st_context_iface will be removed. 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:
parent
fdec352903
commit
c61aa8fa81
8 changed files with 24 additions and 14 deletions
|
|
@ -54,7 +54,8 @@ typedef void (*pp_func) (struct pp_queue_t *, struct pipe_resource *,
|
|||
struct pp_queue_t *pp_init(struct pipe_context *pipe,
|
||||
const unsigned int *enabled,
|
||||
struct cso_context *,
|
||||
struct st_context_iface *st);
|
||||
void *st,
|
||||
void (*st_invalidate_state)(void *st, unsigned flags));
|
||||
|
||||
void pp_run(struct pp_queue_t *, struct pipe_resource *,
|
||||
struct pipe_resource *, struct pipe_resource *);
|
||||
|
|
|
|||
|
|
@ -40,7 +40,8 @@
|
|||
/** Initialize the post-processing queue. */
|
||||
struct pp_queue_t *
|
||||
pp_init(struct pipe_context *pipe, const unsigned int *enabled,
|
||||
struct cso_context *cso, struct st_context_iface *st)
|
||||
struct cso_context *cso, void *st,
|
||||
void (*st_invalidate_state)(void *st, unsigned flags))
|
||||
{
|
||||
unsigned int num_filters = 0;
|
||||
unsigned int curpos = 0, i, tmp_req = 0;
|
||||
|
|
@ -78,7 +79,7 @@ pp_init(struct pipe_context *pipe, const unsigned int *enabled,
|
|||
goto error;
|
||||
}
|
||||
|
||||
ppq->p = pp_init_prog(ppq, pipe, cso, st);
|
||||
ppq->p = pp_init_prog(ppq, pipe, cso, st, st_invalidate_state);
|
||||
if (ppq->p == NULL) {
|
||||
pp_debug("pp_init_prog returned NULL.\n");
|
||||
goto error;
|
||||
|
|
|
|||
|
|
@ -41,7 +41,10 @@ struct pp_program
|
|||
struct pipe_screen *screen;
|
||||
struct pipe_context *pipe;
|
||||
struct cso_context *cso;
|
||||
struct st_context_iface *st;
|
||||
|
||||
/* For notifying st_context to rebind states that we clobbered. */
|
||||
void *st;
|
||||
void (*st_invalidate_state)(void *st, unsigned flags);
|
||||
|
||||
struct pipe_blend_state blend;
|
||||
struct pipe_depth_stencil_alpha_state depthstencil;
|
||||
|
|
@ -95,7 +98,8 @@ void pp_free_fbos(struct pp_queue_t *);
|
|||
void pp_debug(const char *, ...);
|
||||
|
||||
struct pp_program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
|
||||
struct cso_context *, struct st_context_iface *st);
|
||||
struct cso_context *, void *st,
|
||||
void (*st_invalidate_state)(void *st, unsigned flags));
|
||||
|
||||
void pp_blit(struct pipe_context *pipe,
|
||||
struct pipe_resource *src_tex,
|
||||
|
|
|
|||
|
|
@ -41,7 +41,8 @@
|
|||
/** Initialize the internal details */
|
||||
struct pp_program *
|
||||
pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
|
||||
struct cso_context *cso, struct st_context_iface *st)
|
||||
struct cso_context *cso, void *st,
|
||||
void (*st_invalidate_state)(void *st, unsigned flags))
|
||||
{
|
||||
struct pp_program *p;
|
||||
|
||||
|
|
@ -57,6 +58,7 @@ pp_init_prog(struct pp_queue_t *ppq, struct pipe_context *pipe,
|
|||
p->pipe = pipe;
|
||||
p->cso = cso;
|
||||
p->st = st;
|
||||
p->st_invalidate_state = st_invalidate_state;
|
||||
|
||||
{
|
||||
static const float verts[4][2][4] = {
|
||||
|
|
|
|||
|
|
@ -192,11 +192,11 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
|||
|
||||
/* restore states not restored by cso */
|
||||
if (ppq->p->st) {
|
||||
ppq->p->st->invalidate_state(ppq->p->st,
|
||||
ST_INVALIDATE_FS_SAMPLER_VIEWS |
|
||||
ST_INVALIDATE_FS_CONSTBUF0 |
|
||||
ST_INVALIDATE_VS_CONSTBUF0 |
|
||||
ST_INVALIDATE_VERTEX_BUFFERS);
|
||||
ppq->p->st_invalidate_state(ppq->p->st,
|
||||
ST_INVALIDATE_FS_SAMPLER_VIEWS |
|
||||
ST_INVALIDATE_FS_CONSTBUF0 |
|
||||
ST_INVALIDATE_VS_CONSTBUF0 |
|
||||
ST_INVALIDATE_VERTEX_BUFFERS);
|
||||
}
|
||||
|
||||
pipe_resource_reference(&ppq->depth, NULL);
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ dri_create_context(struct dri_screen *screen,
|
|||
|
||||
if (ctx->st->cso_context) {
|
||||
ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context,
|
||||
ctx->st);
|
||||
ctx->st, (void*)ctx->st->invalidate_state);
|
||||
ctx->hud = hud_create(ctx->st->cso_context,
|
||||
share_ctx ? share_ctx->hud : NULL,
|
||||
ctx->st, (void*)ctx->st->invalidate_state);
|
||||
|
|
|
|||
|
|
@ -805,7 +805,8 @@ OSMesaMakeCurrent(OSMesaContext osmesa, void *buffer, GLenum type,
|
|||
osmesa->pp = pp_init(osmesa->stctx->pipe,
|
||||
osmesa->pp_enabled,
|
||||
osmesa->stctx->cso_context,
|
||||
osmesa->stctx);
|
||||
osmesa->stctx,
|
||||
(void*)osmesa->stctx->invalidate_state);
|
||||
|
||||
pp_init_fbos(osmesa->pp, width, height);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -221,7 +221,8 @@ GalliumContext::CreateContext(HGLWinsysContext *wsContext)
|
|||
// Init Gallium3D Post Processing
|
||||
// TODO: no pp filters are enabled yet through postProcessEnable
|
||||
context->postProcess = pp_init(stContext->pipe, context->postProcessEnable,
|
||||
stContext->cso_context, &stContext->iface);
|
||||
stContext->cso_context, &stContext->iface,
|
||||
(void*)stContext->iface.invalidate_state);
|
||||
|
||||
context_id contextNext = -1;
|
||||
Lock();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue