From 3e163a137be7f9a80ec720903c4bda028de5681f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 29 Nov 2012 02:55:01 +0100 Subject: gallium/postprocess: share pipe_context and cso_context with the state tracker Using one context instead of two is more efficient and we can skip another context flush. Reviewed-by: Brian Paul --- src/gallium/auxiliary/postprocess/pp_init.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'src/gallium/auxiliary/postprocess/pp_init.c') diff --git a/src/gallium/auxiliary/postprocess/pp_init.c b/src/gallium/auxiliary/postprocess/pp_init.c index 2dc29ac5b4b..e059be6e9bc 100644 --- a/src/gallium/auxiliary/postprocess/pp_init.c +++ b/src/gallium/auxiliary/postprocess/pp_init.c @@ -39,7 +39,8 @@ /** Initialize the post-processing queue. */ struct pp_queue_t * -pp_init(struct pipe_screen *pscreen, const unsigned int *enabled) +pp_init(struct pipe_context *pipe, const unsigned int *enabled, + struct cso_context *cso) { unsigned int curpos = 0, i, tmp_req = 0; @@ -64,7 +65,7 @@ pp_init(struct pipe_screen *pscreen, const unsigned int *enabled) if (!tmp_q || !ppq || !ppq->shaders || !ppq->verts) goto error; - ppq->p = pp_init_prog(ppq, pscreen); + ppq->p = pp_init_prog(ppq, pipe, cso); if (!ppq->p) goto error; @@ -89,7 +90,7 @@ pp_init(struct pipe_screen *pscreen, const unsigned int *enabled) } } - ppq->p->blitctx = util_create_blit(ppq->p->pipe, ppq->p->cso); + ppq->p->blitctx = util_create_blit(ppq->p->pipe, cso); if (!ppq->p->blitctx) goto error; @@ -152,9 +153,6 @@ pp_free(struct pp_queue_t *ppq) util_destroy_blit(ppq->p->blitctx); - cso_set_sampler_views(ppq->p->cso, PIPE_SHADER_FRAGMENT, 0, NULL); - cso_release_all(ppq->p->cso); - for (i = 0; i < ppq->n_filters; i++) { for (j = 0; j < PP_MAX_PASSES && ppq->shaders[i][j]; j++) { if (j >= ppq->verts[i]) { @@ -168,9 +166,6 @@ pp_free(struct pp_queue_t *ppq) } } - cso_destroy_context(ppq->p->cso); - ppq->p->pipe->destroy(ppq->p->pipe); - FREE(ppq->p); FREE(ppq->pp_queue); FREE(ppq); -- cgit v1.2.3