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