summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gallium/drivers/vc4/vc4_resource.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/drivers/vc4/vc4_resource.c b/src/gallium/drivers/vc4/vc4_resource.c
index a360e192b3f..20f137a8e17 100644
--- a/src/gallium/drivers/vc4/vc4_resource.c
+++ b/src/gallium/drivers/vc4/vc4_resource.c
@@ -294,9 +294,9 @@ vc4_resource_transfer_map(struct pipe_context *pctx,
ptrans->box.height = align(ptrans->box.height, utile_h);
ptrans->stride = ptrans->box.width * rsc->cpp;
- ptrans->layer_stride = ptrans->stride;
+ ptrans->layer_stride = ptrans->stride * ptrans->box.height;
- trans->map = malloc(ptrans->stride * ptrans->box.height);
+ trans->map = malloc(ptrans->layer_stride * ptrans->box.depth);
if (usage & PIPE_TRANSFER_READ ||
ptrans->box.width != orig_width ||
ptrans->box.height != orig_height) {