Lines Matching refs:ppq

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