This is the boring subset of the following commit.
All new parameters are optional.
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
}
void
-hud_run(struct hud_context *hud, struct pipe_resource *tex)
+hud_run(struct hud_context *hud, struct cso_context *cso,
+ struct pipe_resource *tex)
{
hud_stop_queries(hud, hud->record_pipe);
hud_draw_results(hud, tex);
}
struct hud_context *
-hud_create(struct cso_context *cso)
+hud_create(struct cso_context *cso, struct hud_context *share)
{
struct pipe_screen *screen = cso_get_pipe_context(cso)->screen;
struct hud_context *hud;
}
void
-hud_destroy(struct hud_context *hud)
+hud_destroy(struct hud_context *hud, struct cso_context *cso)
{
hud_unset_record_context(hud);
hud_unset_draw_context(hud);
struct util_queue_monitoring;
struct hud_context *
-hud_create(struct cso_context *cso);
+hud_create(struct cso_context *cso, struct hud_context *share);
void
-hud_destroy(struct hud_context *hud);
+hud_destroy(struct hud_context *hud, struct cso_context *cso);
void
-hud_run(struct hud_context *hud, struct pipe_resource *tex);
+hud_run(struct hud_context *hud, struct cso_context *cso,
+ struct pipe_resource *tex);
void
hud_add_queue_for_monitoring(struct hud_context *hud,
if (ctx->st->cso_context) {
ctx->pp = pp_init(ctx->st->pipe, screen->pp_enabled, ctx->st->cso_context);
- ctx->hud = hud_create(ctx->st->cso_context);
+ ctx->hud = hud_create(ctx->st->cso_context, NULL);
}
/* Do this last. */
struct dri_context *ctx = dri_context(cPriv);
if (ctx->hud) {
- hud_destroy(ctx->hud);
+ hud_destroy(ctx->hud, ctx->st->cso_context);
}
if (ctx->pp)
dri_postprocessing(ctx, drawable, ST_ATTACHMENT_BACK_LEFT);
if (ctx->hud) {
- hud_run(ctx->hud, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
+ hud_run(ctx->hud, ctx->st->cso_context,
+ drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
}
pipe->flush_resource(pipe, drawable->textures[ST_ATTACHMENT_BACK_LEFT]);
c->st->st_manager_private = (void *) c;
- c->hud = hud_create(c->st->cso_context);
+ c->hud = hud_create(c->st->cso_context, NULL);
return c;
void XMesaDestroyContext( XMesaContext c )
{
if (c->hud) {
- hud_destroy(c->hud);
+ hud_destroy(c->hud, NULL);
}
c->st->destroy(c->st);
if (xmctx && xmctx->hud) {
struct pipe_resource *back =
xmesa_get_framebuffer_resource(b->stfb, ST_ATTACHMENT_BACK_LEFT);
- hud_run(xmctx->hud, back);
+ hud_run(xmctx->hud, NULL, back);
}
if (xmctx && xmctx->xm_buffer == b) {
if (!This->cso_sw) { return E_OUTOFMEMORY; }
/* Create first, it messes up our state. */
- This->hud = hud_create(This->context.cso); /* NULL result is fine */
+ This->hud = hud_create(This->context.cso, NULL); /* NULL result is fine */
/* Available memory counter. Updated only for allocations with this device
* instance. This is the Win 7 behavior.
if (device->hud && resource) {
/* Implicit use of context pipe */
(void)NineDevice9_GetPipe(This->base.device);
- hud_run(device->hud, resource); /* XXX: no offset */
+ hud_run(device->hud, NULL, resource); /* XXX: no offset */
/* HUD doesn't clobber stipple */
nine_state_restore_non_cso(device);
}
ctx->st->st_manager_private = (void *) ctx;
if (ctx->st->cso_context) {
- ctx->hud = hud_create(ctx->st->cso_context);
+ ctx->hud = hud_create(ctx->st->cso_context, NULL);
}
stw_lock_contexts(stw_dev);
if (old_ctx) {
/* free the old context data associated with this handle */
if (old_ctx->hud) {
- hud_destroy(old_ctx->hud);
+ hud_destroy(old_ctx->hud, NULL);
}
ctx->st->destroy(old_ctx->st);
FREE(old_ctx);
no_hglrc:
if (ctx->hud) {
- hud_destroy(ctx->hud);
+ hud_destroy(ctx->hud, NULL);
}
ctx->st->destroy(ctx->st);
no_st_ctx:
stw_dev->stapi->make_current(stw_dev->stapi, NULL, NULL, NULL);
if (ctx->hud) {
- hud_destroy(ctx->hud);
+ hud_destroy(ctx->hud, NULL);
}
ctx->st->destroy(ctx->st);
struct pipe_resource *back =
stw_get_framebuffer_resource(fb->stfb, ST_ATTACHMENT_BACK_LEFT);
if (back) {
- hud_run(ctx->hud, back);
+ hud_run(ctx->hud, NULL, back);
}
}