}
static void
-emit_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
+emit_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
{
- struct fd_context *ctx = fd_context(pctx);
struct fd_batch *batch;
- fd_fence_ref(pctx->screen, &ctx->last_fence, NULL);
+ fd_fence_ref(ctx->base.screen, &ctx->last_fence, NULL);
batch = fd_bc_alloc_batch(&ctx->screen->batch_cache, ctx, true);
fd_batch_reference(&batch, NULL);
}
-static void
-fd6_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
+static bool
+fd6_blit(struct fd_context *ctx, const struct pipe_blit_info *info)
{
- struct fd_context *ctx = fd_context(pctx);
-
if (!can_do_blit(info)) {
- fd_blitter_blit(ctx, info);
- return;
+ return false;
}
- emit_blit(pctx, info);
-}
-
-static void
-fd6_resource_copy_region(struct pipe_context *pctx,
- struct pipe_resource *dst,
- unsigned dst_level,
- unsigned dstx, unsigned dsty, unsigned dstz,
- struct pipe_resource *src,
- unsigned src_level,
- const struct pipe_box *src_box)
-{
- struct pipe_blit_info info;
-
- debug_assert(src->format == dst->format);
-
- memset(&info, 0, sizeof info);
- info.dst.resource = dst;
- info.dst.level = dst_level;
- info.dst.box.x = dstx;
- info.dst.box.y = dsty;
- info.dst.box.z = dstz;
- info.dst.box.width = src_box->width;
- info.dst.box.height = src_box->height;
- assert(info.dst.box.width >= 0);
- assert(info.dst.box.height >= 0);
- info.dst.box.depth = 1;
- info.dst.format = dst->format;
- info.src.resource = src;
- info.src.level = src_level;
- info.src.box = *src_box;
- info.src.format = src->format;
- info.mask = util_format_get_mask(src->format);
- info.filter = PIPE_TEX_FILTER_NEAREST;
- info.scissor_enable = 0;
-
- if (!can_do_blit(&info)) {
- fd_resource_copy_region(pctx,
- dst, dst_level, dstx, dsty, dstz,
- src, src_level, src_box);
- return;
- }
+ emit_blit(ctx, info);
- emit_blit(pctx, &info);
+ return true;
}
void
if (fd_mesa_debug & FD_DBG_NOBLIT)
return;
- pctx->resource_copy_region = fd6_resource_copy_region;
- pctx->blit = fd6_blit;
+ fd_context(pctx)->blit = fd6_blit;
}
unsigned