aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-11-19 21:04:07 +0100
committerMarek Olšák <[email protected]>2017-11-25 17:16:56 +0100
commit11e25eb7f4538ab7f1ca5d06e8e1ae09be10ad45 (patch)
treef5068d29dcca17e1bdc53ffffe5589c06f8f593e /src/gallium
parent9c5b4eb6b4ea46af274927a0af5907e996bcdcfe (diff)
gallium/hud: update the HUD interface for multiple contexts
This is the boring subset of the following commit. All new parameters are optional. Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/hud/hud_context.c7
-rw-r--r--src/gallium/auxiliary/hud/hud_context.h7
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c4
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c3
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_api.c6
-rw-r--r--src/gallium/state_trackers/nine/device9.c2
-rw-r--r--src/gallium/state_trackers/nine/swapchain9.c2
-rw-r--r--src/gallium/state_trackers/wgl/stw_context.c8
-rw-r--r--src/gallium/state_trackers/wgl/stw_framebuffer.c2
9 files changed, 22 insertions, 19 deletions
diff --git a/src/gallium/auxiliary/hud/hud_context.c b/src/gallium/auxiliary/hud/hud_context.c
index 7502416c5b8..783dafd75f6 100644
--- a/src/gallium/auxiliary/hud/hud_context.c
+++ b/src/gallium/auxiliary/hud/hud_context.c
@@ -681,7 +681,8 @@ hud_stop_queries(struct hud_context *hud, struct pipe_context *pipe)
}
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);
@@ -1684,7 +1685,7 @@ hud_set_record_context(struct hud_context *hud, struct pipe_context *pipe)
}
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;
@@ -1790,7 +1791,7 @@ hud_create(struct cso_context *cso)
}
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);
diff --git a/src/gallium/auxiliary/hud/hud_context.h b/src/gallium/auxiliary/hud/hud_context.h
index 97aa709f061..128d4ef9ab8 100644
--- a/src/gallium/auxiliary/hud/hud_context.h
+++ b/src/gallium/auxiliary/hud/hud_context.h
@@ -35,13 +35,14 @@ struct pipe_resource;
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,
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 2f69f255250..d4ac8adee1b 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -168,7 +168,7 @@ dri_create_context(gl_api api, const struct gl_config * visual,
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. */
@@ -206,7 +206,7 @@ dri_destroy_context(__DRIcontext * cPriv)
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)
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 53dbfd707ef..92ce9d288b1 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -519,7 +519,8 @@ dri_flush(__DRIcontext *cPriv,
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]);
diff --git a/src/gallium/state_trackers/glx/xlib/xm_api.c b/src/gallium/state_trackers/glx/xlib/xm_api.c
index 79bf45d7d78..934c0aba118 100644
--- a/src/gallium/state_trackers/glx/xlib/xm_api.c
+++ b/src/gallium/state_trackers/glx/xlib/xm_api.c
@@ -1035,7 +1035,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list,
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;
@@ -1051,7 +1051,7 @@ PUBLIC
void XMesaDestroyContext( XMesaContext c )
{
if (c->hud) {
- hud_destroy(c->hud);
+ hud_destroy(c->hud, NULL);
}
c->st->destroy(c->st);
@@ -1357,7 +1357,7 @@ void XMesaSwapBuffers( XMesaBuffer b )
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) {
diff --git a/src/gallium/state_trackers/nine/device9.c b/src/gallium/state_trackers/nine/device9.c
index f1c50d6d208..34f903a6947 100644
--- a/src/gallium/state_trackers/nine/device9.c
+++ b/src/gallium/state_trackers/nine/device9.c
@@ -205,7 +205,7 @@ NineDevice9_ctor( struct NineDevice9 *This,
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.
diff --git a/src/gallium/state_trackers/nine/swapchain9.c b/src/gallium/state_trackers/nine/swapchain9.c
index 096d582d97a..f24a7d05437 100644
--- a/src/gallium/state_trackers/nine/swapchain9.c
+++ b/src/gallium/state_trackers/nine/swapchain9.c
@@ -606,7 +606,7 @@ handle_draw_cursor_and_hud( struct NineSwapChain9 *This, struct pipe_resource *r
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);
}
diff --git a/src/gallium/state_trackers/wgl/stw_context.c b/src/gallium/state_trackers/wgl/stw_context.c
index 2155fbfcff5..a9e4024c236 100644
--- a/src/gallium/state_trackers/wgl/stw_context.c
+++ b/src/gallium/state_trackers/wgl/stw_context.c
@@ -278,7 +278,7 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, DHGLRC hShareContext,
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);
@@ -291,7 +291,7 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, DHGLRC hShareContext,
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);
@@ -316,7 +316,7 @@ stw_create_context_attribs(HDC hdc, INT iLayerPlane, DHGLRC hShareContext,
no_hglrc:
if (ctx->hud) {
- hud_destroy(ctx->hud);
+ hud_destroy(ctx->hud, NULL);
}
ctx->st->destroy(ctx->st);
no_st_ctx:
@@ -348,7 +348,7 @@ DrvDeleteContext(DHGLRC dhglrc)
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);
diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c
index 47e76c6d6d6..232ab1d2305 100644
--- a/src/gallium/state_trackers/wgl/stw_framebuffer.c
+++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c
@@ -641,7 +641,7 @@ DrvSwapBuffers(HDC hdc)
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);
}
}