summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/iris/iris_resource.c
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2018-08-14 16:44:07 -0700
committerKenneth Graunke <[email protected]>2019-02-21 10:26:08 -0800
commit84832ab7d41ef6a29faf7442c59bac098ac050e3 (patch)
treec8af3ee1121d2bee08178bda68befdb271ba74da /src/gallium/drivers/iris/iris_resource.c
parentbce7398646dc0c2332d14809a229334d86d9be12 (diff)
iris: Fix tiled memcpy for cubes...and for array slices
tiled_memcpy_map was not offsetting map->ptr based on the slice, while unmap was. also, we were doing offsetting wrong for cubes.
Diffstat (limited to 'src/gallium/drivers/iris/iris_resource.c')
-rw-r--r--src/gallium/drivers/iris/iris_resource.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index a1c703d7c72..6423dea9be7 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -652,7 +652,7 @@ iris_unmap_tiled_memcpy(struct iris_transfer *map)
unsigned x1, x2, y1, y2;
tile_extents(surf, &box, xfer->level, &x1, &x2, &y1, &y2);
- void *ptr = map->ptr + box.z * xfer->layer_stride;
+ void *ptr = map->ptr + s * xfer->layer_stride;
isl_memcpy_linear_to_tiled(x1, x2, y1, y2, dst, ptr,
surf->row_pitch_B, xfer->stride,
@@ -698,9 +698,16 @@ iris_map_tiled_memcpy(struct iris_transfer *map)
unsigned x1, x2, y1, y2;
tile_extents(surf, &box, xfer->level, &x1, &x2, &y1, &y2);
- isl_memcpy_tiled_to_linear(x1, x2, y1, y2, map->ptr, src,
- xfer->stride, surf->row_pitch_B,
- has_swizzling, surf->tiling, ISL_MEMCPY);
+ /* When transferring cubes, box.depth is counted in cubes, but
+ * box.z is counted in faces. We want to transfer only the
+ * specified face, but for all array elements. So, use 's'
+ * (the zero-based slice count) rather than box.z.
+ */
+ void *ptr = map->ptr + s * xfer->layer_stride;
+
+ isl_memcpy_tiled_to_linear(x1, x2, y1, y2, ptr, src, xfer->stride,
+ surf->row_pitch_B, has_swizzling,
+ surf->tiling, ISL_MEMCPY);
box.z++;
}
}