summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2014-02-11 03:02:35 +0100
committerMarek Olšák <[email protected]>2014-02-25 16:08:22 +0100
commitb9aa8ed009c22e4ef5df49dc7785f08fd3dbe836 (patch)
treef848d600312d2ab8f68d9488ee7f8604a63182b0 /src/gallium/drivers/radeonsi
parentf7176d700f265ed3c3fdec5a09cbfbe2c93c7e2f (diff)
radeonsi: inline util_blitter_copy_texture
This will be used for changing texture properties without modifying pipe_resource like r600g, but not in this series. For now, this change allows consolidation of pipe_surface functions. Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi')
-rw-r--r--src/gallium/drivers/radeonsi/si_blit.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
index 8bfa6ed96e6..07396e79a1e 100644
--- a/src/gallium/drivers/radeonsi/si_blit.c
+++ b/src/gallium/drivers/radeonsi/si_blit.c
@@ -483,8 +483,10 @@ static void si_resource_copy_region(struct pipe_context *ctx,
const struct pipe_box *src_box)
{
struct si_context *sctx = (struct si_context *)ctx;
+ struct pipe_surface *dst_view, dst_templ;
+ struct pipe_sampler_view src_templ, *src_view;
struct texture_orig_info orig_info[2];
- struct pipe_box sbox;
+ struct pipe_box sbox, dstbox;
boolean restore_orig[2];
/* Fallback for buffers. */
@@ -562,11 +564,27 @@ static void si_resource_copy_region(struct pipe_context *ctx,
restore_orig[1] = TRUE;
}
+ /* Initialize the surface. */
+ util_blitter_default_dst_texture(&dst_templ, dst, dst_level, dstz);
+ dst_view = ctx->create_surface(ctx, dst, &dst_templ);
+
+ /* Initialize the sampler view. */
+ util_blitter_default_src_texture(&src_templ, src, src_level);
+ src_view = ctx->create_sampler_view(ctx, src, &src_templ);
+
+ u_box_3d(dstx, dsty, dstz, abs(src_box->width), abs(src_box->height),
+ abs(src_box->depth), &dstbox);
+
+ /* Copy. */
si_blitter_begin(ctx, SI_COPY);
- util_blitter_copy_texture(sctx->blitter, dst, dst_level, dstx, dsty, dstz,
- src, src_level, src_box);
+ util_blitter_blit_generic(sctx->blitter, dst_view, &dstbox,
+ src_view, src_box, src->width0, src->height0,
+ PIPE_MASK_RGBAZS, PIPE_TEX_FILTER_NEAREST, NULL);
si_blitter_end(ctx);
+ pipe_surface_reference(&dst_view, NULL);
+ pipe_sampler_view_reference(&src_view, NULL);
+
if (restore_orig[0])
si_reset_blittable_to_orig(src, src_level, &orig_info[0]);