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>
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 *);
/** 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;
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;
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;
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,
/** 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;
p->pipe = pipe;
p->cso = cso;
p->st = st;
+ p->st_invalidate_state = st_invalidate_state;
{
static const float verts[4][2][4] = {
/* 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);
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);
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);
}
// 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();