aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_blit.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-12-23 23:04:37 -0800
committerKenneth Graunke <[email protected]>2019-02-21 10:26:11 -0800
commit7a9e87c224cfe0854258ef293b017f3685626868 (patch)
treeb4330e56a800f5355cb6857f9660cb78d37e508f /src/gallium/drivers/iris/iris_blit.c
parent307f3f9924791ab0f1b830e4739bc10c28025e5a (diff)
iris: Implement multi-slice copy_region
I don't know if this is required - surprisingly, I haven't seen it matter - but I'd like to use it for multi-slice transfer maps. We may as well do the right thing.
Diffstat (limited to 'src/gallium/drivers/iris/iris_blit.c')
-rw-r--r--src/gallium/drivers/iris/iris_blit.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index 10b326e1884..6756ae0aeb8 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -411,8 +411,6 @@ iris_resource_copy_region(struct pipe_context *ctx,
struct iris_context *ice = (void *) ctx;
struct iris_batch *batch = &ice->batches[IRIS_BATCH_RENDER];
- iris_batch_maybe_flush(batch, 1500);
-
blorp_batch_init(&ice->blorp, &blorp_batch, batch, 0);
if (dst->target == PIPE_BUFFER && src->target == PIPE_BUFFER) {
@@ -423,6 +421,8 @@ iris_resource_copy_region(struct pipe_context *ctx,
.buffer = iris_resource_bo(dst), .offset = dstx,
};
+ iris_batch_maybe_flush(batch, 1500);
+
blorp_buffer_copy(&blorp_batch, src_addr, dst_addr, src_box->width);
} else {
// XXX: what about one surface being a buffer and not the other?
@@ -431,16 +431,14 @@ iris_resource_copy_region(struct pipe_context *ctx,
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;
-
- assert(src_box->depth == 1);
+ for (int slice = 0; slice < src_box->depth; slice++) {
+ iris_batch_maybe_flush(batch, 1500);
- 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_copy(&blorp_batch, &src_surf, src_level, src_box->z + slice,
+ &dst_surf, dst_level, dstz + slice,
+ src_box->x, src_box->y, dstx, dsty,
+ src_box->width, src_box->height);
+ }
}
blorp_batch_finish(&blorp_batch);