/* restore states not restored by cso */
if (hud->st) {
- hud->st->invalidate_state(hud->st,
- ST_INVALIDATE_FS_SAMPLER_VIEWS |
- ST_INVALIDATE_VS_CONSTBUF0 |
- ST_INVALIDATE_VERTEX_BUFFERS);
+ hud->st_invalidate_state(hud->st,
+ ST_INVALIDATE_FS_SAMPLER_VIEWS |
+ ST_INVALIDATE_VS_CONSTBUF0 |
+ ST_INVALIDATE_VERTEX_BUFFERS);
}
pipe_surface_reference(&surf, NULL);
static bool
hud_set_draw_context(struct hud_context *hud, struct cso_context *cso,
- struct st_context_iface *st)
+ void *st,
+ void (*st_invalidate_state)(void *st, unsigned flags))
{
struct pipe_context *pipe = cso_get_pipe_context(cso);
hud->pipe = pipe;
hud->cso = cso;
hud->st = st;
+ hud->st_invalidate_state = st_invalidate_state;
struct pipe_sampler_view view_templ;
u_sampler_view_default_template(
* record queries in one context and draw them in another.
*/
struct hud_context *
-hud_create(struct cso_context *cso, struct st_context_iface *st,
- struct hud_context *share)
+hud_create(struct cso_context *cso, struct hud_context *share,
+ void *st, void (*st_invalidate_state)(void *st, unsigned flags))
{
const char *share_env = debug_get_option("GALLIUM_HUD_SHARE", NULL);
unsigned record_ctx = 0, draw_ctx = 0;
if (context_id == draw_ctx) {
assert(!share->pipe);
- hud_set_draw_context(share, cso, st);
+ hud_set_draw_context(share, cso, st, st_invalidate_state);
}
return share;
if (record_ctx == 0)
hud_set_record_context(hud, cso_get_pipe_context(cso));
if (draw_ctx == 0)
- hud_set_draw_context(hud, cso, st);
+ hud_set_draw_context(hud, cso, st, st_invalidate_state);
hud_parse_env_var(hud, screen, env);
return hud;
struct pipe_context;
struct pipe_resource;
struct util_queue_monitoring;
-struct st_context_iface;
struct hud_context *
-hud_create(struct cso_context *cso, struct st_context_iface *st,
- struct hud_context *share);
+hud_create(struct cso_context *cso, struct hud_context *share,
+ void *st, void (*st_invalidate_state)(void *st, unsigned flags));
void
hud_destroy(struct hud_context *hud, struct cso_context *cso);
if (ctx->st->cso_context) {
ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context,
ctx->st);
- ctx->hud = hud_create(ctx->st->cso_context, ctx->st,
- share_ctx ? share_ctx->hud : NULL);
+ ctx->hud = hud_create(ctx->st->cso_context,
+ share_ctx ? share_ctx->hud : NULL,
+ ctx->st, (void*)ctx->st->invalidate_state);
}
/* Do this last. */
if (!This->cso_sw) { return E_OUTOFMEMORY; }
/* Create first, it messes up our state. */
- This->hud = hud_create(This->context.cso, NULL, NULL); /* NULL result is fine */
+ This->hud = hud_create(This->context.cso, NULL, NULL, NULL); /* NULL result is fine */
This->allocator = nine_allocator_create(This, pCTX->memfd_virtualsizelimit);