Lines Matching refs:ppq

47    struct pp_queue_t *ppq;  in pp_init()  local
59 ppq = CALLOC(1, sizeof(struct pp_queue_t)); in pp_init()
61 if (!ppq) { in pp_init()
66 ppq->pp_queue = CALLOC(num_filters, sizeof(pp_func)); in pp_init()
67 if (ppq->pp_queue == NULL) { in pp_init()
72 ppq->shaders = CALLOC(num_filters, sizeof(void *)); in pp_init()
73 ppq->filters = CALLOC(num_filters, sizeof(unsigned int)); in pp_init()
75 if ((ppq->shaders == NULL) || in pp_init()
76 (ppq->filters == NULL)) { in pp_init()
81 ppq->p = pp_init_prog(ppq, pipe, cso); in pp_init()
82 if (ppq->p == NULL) { in pp_init()
91 ppq->pp_queue[curpos] = pp_filters[i].main; in pp_init()
93 ppq->filters[curpos] = i; in pp_init()
96 ppq->shaders[curpos] = in pp_init()
98 if (!ppq->shaders[curpos]) { in pp_init()
105 if (!pp_filters[i].init(ppq, curpos, enabled[i])) { in pp_init()
114 ppq->n_filters = curpos; in pp_init()
115 ppq->n_tmp = (curpos > 2 ? 2 : 1); in pp_init()
116 ppq->n_inner_tmp = tmp_req; in pp_init()
118 ppq->fbos_init = false; in pp_init()
121 ppq->shaders[i][0] = ppq->p->passvs; in pp_init()
125 return ppq; in pp_init()
129 if (ppq) { in pp_init()
131 ppq->n_filters = curpos; in pp_init()
134 pp_free(ppq); in pp_init()
142 pp_free_fbos(struct pp_queue_t *ppq) in pp_free_fbos() argument
147 if (!ppq->fbos_init) in pp_free_fbos()
150 for (i = 0; i < ppq->n_tmp; i++) { in pp_free_fbos()
151 pipe_surface_reference(&ppq->tmps[i], NULL); in pp_free_fbos()
152 pipe_resource_reference(&ppq->tmp[i], NULL); in pp_free_fbos()
154 for (i = 0; i < ppq->n_inner_tmp; i++) { in pp_free_fbos()
155 pipe_surface_reference(&ppq->inner_tmps[i], NULL); in pp_free_fbos()
156 pipe_resource_reference(&ppq->inner_tmp[i], NULL); in pp_free_fbos()
158 pipe_surface_reference(&ppq->stencils, NULL); in pp_free_fbos()
159 pipe_resource_reference(&ppq->stencil, NULL); in pp_free_fbos()
161 ppq->fbos_init = false; in pp_free_fbos()
169 pp_free(struct pp_queue_t *ppq) in pp_free() argument
173 if (!ppq) in pp_free()
176 pp_free_fbos(ppq); in pp_free()
178 if (ppq->p) { in pp_free()
179 if (ppq->p->pipe && ppq->filters && ppq->shaders) { in pp_free()
180 for (i = 0; i < ppq->n_filters; i++) { in pp_free()
181 unsigned int filter = ppq->filters[i]; in pp_free()
183 if (ppq->shaders[i] == NULL) { in pp_free()
192 if (ppq->shaders[i][j] == NULL) { in pp_free()
197 if (ppq->shaders[i][j] == ppq->p->passvs) { in pp_free()
201 assert(ppq); in pp_free()
202 assert(ppq->p); in pp_free()
203 assert(ppq->p->pipe); in pp_free()
206 assert(ppq->p->pipe->delete_fs_state); in pp_free()
207 ppq->p->pipe->delete_fs_state(ppq->p->pipe, in pp_free()
208 ppq->shaders[i][j]); in pp_free()
209 ppq->shaders[i][j] = NULL; in pp_free()
211 assert(ppq->p->pipe->delete_vs_state); in pp_free()
212 ppq->p->pipe->delete_vs_state(ppq->p->pipe, in pp_free()
213 ppq->shaders[i][j]); in pp_free()
214 ppq->shaders[i][j] = NULL; in pp_free()
219 pp_filters[filter].free(ppq, i); in pp_free()
223 FREE(ppq->p); in pp_free()
230 FREE(ppq->filters); in pp_free()
231 FREE(ppq->shaders); in pp_free()
232 FREE(ppq->pp_queue); in pp_free()
234 FREE(ppq); in pp_free()
255 pp_init_fbos(struct pp_queue_t *ppq, unsigned int w, in pp_init_fbos() argument
259 struct pp_program *p = ppq->p; /* The lazy will inherit the earth */ in pp_init_fbos()
264 if (ppq->fbos_init) in pp_init_fbos()
268 pp_debug("Requesting %u temps and %u inner temps\n", ppq->n_tmp, in pp_init_fbos()
269 ppq->n_inner_tmp); in pp_init_fbos()
285 for (i = 0; i < ppq->n_tmp; i++) { in pp_init_fbos()
286 ppq->tmp[i] = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
287 ppq->tmps[i] = p->pipe->create_surface(p->pipe, ppq->tmp[i], &p->surf); in pp_init_fbos()
289 if (!ppq->tmp[i] || !ppq->tmps[i]) in pp_init_fbos()
293 for (i = 0; i < ppq->n_inner_tmp; i++) { in pp_init_fbos()
294 ppq->inner_tmp[i] = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
295 ppq->inner_tmps[i] = p->pipe->create_surface(p->pipe, in pp_init_fbos()
296 ppq->inner_tmp[i], in pp_init_fbos()
299 if (!ppq->inner_tmp[i] || !ppq->inner_tmps[i]) in pp_init_fbos()
317 ppq->stencil = p->screen->resource_create(p->screen, &tmp_res); in pp_init_fbos()
318 ppq->stencils = p->pipe->create_surface(p->pipe, ppq->stencil, &p->surf); in pp_init_fbos()
319 if (!ppq->stencil || !ppq->stencils) in pp_init_fbos()
328 ppq->fbos_init = true; in pp_init_fbos()