struct program *pp_init_prog(struct pp_queue_t *, struct pipe_context *pipe,
struct cso_context *);
void pp_init_fbos(struct pp_queue_t *, unsigned int, unsigned int);
+void pp_blit(struct pipe_context *pipe,
+ struct pipe_resource *src_tex,
+ int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ int srcZ0,
+ struct pipe_surface *dst,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1);
/* The filters */
#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->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;
pp_free_fbos(ppq);
if (ppq && ppq->p) {
- /* Only destroy created contexts. */
- if (ppq->p->blitctx) {
- util_destroy_blit(ppq->p->blitctx);
- }
-
if (ppq->p->pipe && ppq->filters && ppq->shaders) {
for (i = 0; i < ppq->n_filters; i++) {
unsigned int filter = ppq->filters[i];
#include "postprocess/postprocess.h"
#include "postprocess/pp_mlaa.h"
#include "postprocess/pp_filters.h"
-#include "util/u_blit.h"
#include "util/u_box.h"
#include "util/u_sampler.h"
#include "util/u_inlines.h"
pp_filter_set_fb(p);
/* Blit the input to the output */
- util_blit_pixels(p->blitctx, in, 0, 0, 0,
- w, h, 0, p->framebuffer.cbufs[0],
- 0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
- TGSI_WRITEMASK_XYZW, 0);
+ pp_blit(p->pipe, in, 0, 0,
+ w, h, 0, p->framebuffer.cbufs[0],
+ 0, 0, w, h);
u_sampler_view_default_template(&v_tmp, in, in->format);
arr[0] = p->pipe->create_sampler_view(p->pipe, in, &v_tmp);
struct pipe_resource *vbuf;
struct pipe_surface surf;
struct pipe_sampler_view *view;
-
- struct blit_state *blitctx;
};
#include "postprocess.h"
#include "postprocess/pp_filters.h"
-#include "util/u_blit.h"
#include "util/u_inlines.h"
#include "util/u_sampler.h"
#include "tgsi/tgsi_parse.h"
+void
+pp_blit(struct pipe_context *pipe,
+ struct pipe_resource *src_tex,
+ int srcX0, int srcY0,
+ int srcX1, int srcY1,
+ int srcZ0,
+ struct pipe_surface *dst,
+ int dstX0, int dstY0,
+ int dstX1, int dstY1)
+{
+ struct pipe_blit_info blit;
+
+ memset(&blit, 0, sizeof(blit));
+
+ blit.src.resource = src_tex;
+ blit.src.level = 0;
+ blit.src.format = src_tex->format;
+ blit.src.box.x = srcX0;
+ blit.src.box.y = srcY0;
+ blit.src.box.z = srcZ0;
+ blit.src.box.width = srcX1 - srcX0;
+ blit.src.box.height = srcY1 - srcY0;
+ blit.src.box.depth = 1;
+
+ blit.dst.resource = dst->texture;
+ blit.dst.level = dst->u.tex.level;
+ blit.dst.format = dst->format;
+ blit.dst.box.x = dstX0;
+ blit.dst.box.y = dstY0;
+ blit.dst.box.z = 0;
+ blit.dst.box.width = dstX1 - dstX0;
+ blit.dst.box.height = dstY1 - dstY0;
+ blit.dst.box.depth = 1;
+
+ blit.mask = PIPE_MASK_RGBA;
+
+ pipe->blit(pipe, &blit);
+}
+
/**
* Main run function of the PP queue. Called on swapbuffers/flush.
*
unsigned int w = ppq->p->framebuffer.width;
unsigned int h = ppq->p->framebuffer.height;
- util_blit_pixels(ppq->p->blitctx, in, 0, 0, 0,
- w, h, 0, ppq->tmps[0],
- 0, 0, w, h, 0, PIPE_TEX_MIPFILTER_NEAREST,
- TGSI_WRITEMASK_XYZW, 0);
+
+ pp_blit(ppq->p->pipe, in, 0, 0,
+ w, h, 0, ppq->tmps[0],
+ 0, 0, w, h);
in = ppq->tmp[0];
}