aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-06-26 00:28:52 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:07 -0800
commit4d04111bfbd909c16762cbb65778f7308d640d36 (patch)
tree07dd6fc6e5055e24ff78f71e323ad0a97f5dcfa3 /src
parent40fd2fd603bb958795ef31bbcbc2b05d2d37fa36 (diff)
iris: implement copy image
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/iris/iris_blit.c28
-rw-r--r--src/gallium/drivers/iris/iris_resource.c12
2 files changed, 28 insertions, 12 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index ea61c253987..79d98792f93 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -112,8 +112,36 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
blorp_batch_finish(&blorp_batch);
}
+static void
+iris_resource_copy_region(struct pipe_context *ctx,
+ 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 iris_context *ice = (void *) ctx;
+ struct blorp_surf src_surf, dst_surf;
+ iris_blorp_surf_for_resource(&src_surf, src, ISL_AUX_USAGE_NONE, false);
+ iris_blorp_surf_for_resource(&dst_surf, dst, ISL_AUX_USAGE_NONE, true);
+
+ // XXX: ???
+ unsigned dst_layer = dstz;
+ unsigned src_layer = src_box->z;
+
+ struct blorp_batch blorp_batch;
+ blorp_batch_init(&ice->blorp, &blorp_batch, &ice->render_batch, 0);
+ blorp_copy(&blorp_batch, &src_surf, src_level, src_layer,
+ &dst_surf, dst_level, dst_layer,
+ src_box->x, src_box->y, dstx, dsty,
+ src_box->width, src_box->height);
+ blorp_batch_finish(&blorp_batch);
+}
+
void
iris_init_blit_functions(struct pipe_context *ctx)
{
ctx->blit = iris_blit;
+ ctx->resource_copy_region = iris_resource_copy_region;
}
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 67772a3317f..924a6919989 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -586,17 +586,6 @@ iris_transfer_unmap(struct pipe_context *pipe, struct pipe_transfer *xfer)
}
static void
-iris_resource_copy_region(struct pipe_context *ctx,
- 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)
-{
-}
-
-static void
iris_flush_resource(struct pipe_context *ctx, struct pipe_resource *resource)
{
}
@@ -621,5 +610,4 @@ iris_init_resource_functions(struct pipe_context *ctx)
ctx->transfer_unmap = iris_transfer_unmap;
ctx->buffer_subdata = u_default_buffer_subdata;
ctx->texture_subdata = u_default_texture_subdata;
- ctx->resource_copy_region = iris_resource_copy_region;
}