#include "pipe/p_compiler.h"
#include "postprocess/filters.h"
+#include "postprocess/pp_private.h"
#include "pipe/p_screen.h"
#include "util/u_inlines.h"
-#include "util/u_blit.h"
#include "util/u_math.h"
#include "util/u_debug.h"
#include "util/u_memory.h"
ppq = CALLOC(1, sizeof(struct pp_queue_t));
- if (ppq == NULL) {
+ if (!ppq) {
pp_debug("Unable to allocate memory for ppq.\n");
goto error;
}
}
}
- ppq->p->blitctx = util_create_blit(ppq->p->pipe, cso);
-
- if (ppq->p->blitctx == NULL) {
- pp_debug("Unable to create a blit context.\n");
- goto error;
- }
-
ppq->n_filters = curpos;
ppq->n_tmp = (curpos > 2 ? 2 : 1);
ppq->n_inner_tmp = tmp_req;
{
unsigned int i, j;
- pp_free_fbos(ppq);
+ if (!ppq)
+ return;
- if (ppq && ppq->p) {
- /* Only destroy created contexts. */
- if (ppq->p->blitctx) {
- util_destroy_blit(ppq->p->blitctx);
- }
+ pp_free_fbos(ppq);
+ if (ppq->p) {
if (ppq->p->pipe && ppq->filters && ppq->shaders) {
for (i = 0; i < ppq->n_filters; i++) {
unsigned int filter = ppq->filters[i];
FREE(ppq->p);
}
- if (ppq) {
- /*
- * Handle partial initialization for common resource destruction
- * in the create path.
- */
- FREE(ppq->filters);
- FREE(ppq->shaders);
- FREE(ppq->pp_queue);
+ /*
+ * Handle partial initialization for common resource destruction
+ * in the create path.
+ */
+ FREE(ppq->filters);
+ FREE(ppq->shaders);
+ FREE(ppq->pp_queue);
- FREE(ppq);
- }
+ FREE(ppq);
pp_debug("Queue taken down.\n");
}
unsigned int h)
{
- struct program *p = ppq->p; /* The lazy will inherit the earth */
+ struct pp_program *p = ppq->p; /* The lazy will inherit the earth */
unsigned int i;
struct pipe_resource tmp_res;
p->viewport.scale[0] = p->viewport.translate[0] = (float) w / 2.0f;
p->viewport.scale[1] = p->viewport.translate[1] = (float) h / 2.0f;
- p->viewport.scale[3] = 1.0f;
- p->viewport.translate[3] = 0.0f;
ppq->fbos_init = true;