diff options
author | Eric Anholt <[email protected]> | 2016-05-18 12:29:02 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2016-05-18 17:30:07 -0700 |
commit | a507dcc1601d436f6b68fc59a8a8393773d6fd8b (patch) | |
tree | d090566406e88c09153de5d502d1b2f49a8686e0 /src | |
parent | 7ac08adfb4af3157171a565e353f608365c5dde5 (diff) |
vc4: Size transfer temporary mappings appropriately for full maps of 3D.
We don't really support reading/writing of 3D textures since the hardware
doesn't do 3D, but we do need to make sure that a pipe_transfer for them
has enough space to store the image. This was previously not a problem
because the state tracker only mapped a slice at a time until
fb9fe352ea41c7e3633ba2c483c59b73c529845b. Fixes glean glsl1 tests, which
all have setup of a 3D texture at the start.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/vc4/vc4_resource.c | 4 |
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) { |