diff options
author | Marek Olšák <[email protected]> | 2012-11-29 02:55:01 +0100 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2012-11-29 20:31:41 +0100 |
commit | 3e163a137be7f9a80ec720903c4bda028de5681f (patch) | |
tree | f227c113227d2440d700d66bb6fc9dc27d98b9b1 /src/gallium/auxiliary/postprocess/pp_init.c | |
parent | 135fe907a016ec20b6779f6b3a657563e89c1081 (diff) |
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 <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/postprocess/pp_init.c')
-rw-r--r-- | src/gallium/auxiliary/postprocess/pp_init.c | 13 |
1 files changed, 4 insertions, 9 deletions
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); |