Lines Matching refs:ppq

46    struct pp_queue_t *ppq;  in pp_init()  local
59 ppq = CALLOC(1, sizeof(struct pp_queue_t)); in pp_init()
61 ppq->shaders = CALLOC(curpos, sizeof(void *)); in pp_init()
62 ppq->verts = CALLOC(curpos, sizeof(unsigned int)); in pp_init()
64 if (!tmp_q || !ppq || !ppq->shaders || !ppq->verts) in pp_init()
67 ppq->p = pp_init_prog(ppq, pscreen); in pp_init()
68 if (!ppq->p) in pp_init()
73 ppq->pp_queue = tmp_q; in pp_init()
76 ppq->pp_queue[curpos] = pp_filters[i].main; in pp_init()
80 ppq->shaders[curpos] = in pp_init()
82 ppq->verts[curpos] = pp_filters[i].verts; in pp_init()
83 if (!ppq->shaders[curpos]) in pp_init()
86 pp_filters[i].init(ppq, curpos, enabled[i]); in pp_init()
92 ppq->p->blitctx = util_create_blit(ppq->p->pipe, ppq->p->cso); in pp_init()
93 if (!ppq->p->blitctx) in pp_init()
96 ppq->n_filters = curpos; in pp_init()
97 ppq->n_tmp = (curpos > 2 ? 2 : 1); in pp_init()
98 ppq->n_inner_tmp = tmp_req; in pp_init()
100 ppq->fbos_init = false; in pp_init()
103 ppq->shaders[i][0] = ppq->p->passvs; in pp_init()
107 return ppq; in pp_init()
112 if (ppq) in pp_init()
113 FREE(ppq->p); in pp_init()
114 FREE(ppq); in pp_init()
122 pp_free_fbos(struct pp_queue_t *ppq) in pp_free_fbos() argument
127 if (!ppq->fbos_init) in pp_free_fbos()
130 for (i = 0; i < ppq->n_tmp; i++) { in pp_free_fbos()
131 pipe_surface_reference(&ppq->tmps[i], NULL); in pp_free_fbos()
132 pipe_resource_reference(&ppq->tmp[i], NULL); in pp_free_fbos()
134 for (i = 0; i < ppq->n_inner_tmp; i++) { in pp_free_fbos()
135 pipe_surface_reference(&ppq->inner_tmps[i], NULL); in pp_free_fbos()
136 pipe_resource_reference(&ppq->inner_tmp[i], NULL); in pp_free_fbos()
138 pipe_surface_reference(&ppq->stencils, NULL); in pp_free_fbos()
139 pipe_resource_reference(&ppq->stencil, NULL); in pp_free_fbos()
141 ppq->fbos_init = false; in pp_free_fbos()
146 pp_free(struct pp_queue_t *ppq) in pp_free() argument
151 pp_free_fbos(ppq); in pp_free()
153 util_destroy_blit(ppq->p->blitctx); in pp_free()
155 cso_set_sampler_views(ppq->p->cso, PIPE_SHADER_FRAGMENT, 0, NULL); in pp_free()
156 cso_release_all(ppq->p->cso); in pp_free()
158 for (i = 0; i < ppq->n_filters; i++) { in pp_free()
159 for (j = 0; j < PP_MAX_PASSES && ppq->shaders[i][j]; j++) { in pp_free()
160 if (j >= ppq->verts[i]) { in pp_free()
161 ppq->p->pipe->delete_fs_state(ppq->p->pipe, ppq->shaders[i][j]); in pp_free()
162 ppq->shaders[i][j] = NULL; in pp_free()
164 else if (ppq->shaders[i][j] != ppq->p->passvs) { in pp_free()
165 ppq->p->pipe->delete_vs_state(ppq->p->pipe, ppq->shaders[i][j]); in pp_free()
166 ppq->shaders[i][j] = NULL; in pp_free()
171 cso_destroy_context(ppq->p->cso); in pp_free()
172 ppq->p->pipe->destroy(ppq->p->pipe); in pp_free()
174 FREE(ppq->p); in pp_free()
175 FREE(ppq->pp_queue); in pp_free()
176 FREE(ppq); in pp_free()
197 pp_init_fbos(struct pp_queue_t *ppq, unsigned int w, in pp_init_fbos() argument
201 struct program *p = ppq->p; /* The lazy will inherit the earth */ in pp_init_fbos()
206 if (ppq->fbos_init) in pp_init_fbos()
210 pp_debug("Requesting %u temps and %u inner temps\n", ppq->n_tmp, in pp_init_fbos()
211 ppq->n_inner_tmp); in pp_init_fbos()
227 for (i = 0; i < ppq->n_tmp; i++) { in pp_init_fbos()
228 ppq->tmp[i] = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
229 ppq->tmps[i] = p->pipe->create_surface(p->pipe, ppq->tmp[i], &p->surf); in pp_init_fbos()
231 if (!ppq->tmp[i] || !ppq->tmps[i]) in pp_init_fbos()
235 for (i = 0; i < ppq->n_inner_tmp; i++) { in pp_init_fbos()
236 ppq->inner_tmp[i] = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
237 ppq->inner_tmps[i] = p->pipe->create_surface(p->pipe, in pp_init_fbos()
238 ppq->inner_tmp[i], in pp_init_fbos()
241 if (!ppq->inner_tmp[i] || !ppq->inner_tmps[i]) in pp_init_fbos()
259 ppq->stencil = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
260 ppq->stencils = p->pipe->create_surface(p->pipe, ppq->stencil, &p->surf); in pp_init_fbos()
261 if (!ppq->stencil || !ppq->stencils) in pp_init_fbos()
273 ppq->fbos_init = true; in pp_init_fbos()