summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-06-24 16:15:02 -0600
committerBrian Paul <[email protected]>2013-06-25 17:54:24 -0600
commit0b994961ff58654f330c51caacf9698f7dafd6b6 (patch)
tree4eb5b54443272af88648ef351e92d2ac09c6774a
parent808da7d8ca26f71832dc94bb50180b60a5ee3af2 (diff)
svga: allow 3D transfers in svga_texture_transfer_map()
Reviewed-by: Jose Fonseca <[email protected]>
-rw-r--r--src/gallium/drivers/svga/svga_resource_texture.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/svga/svga_resource_texture.c b/src/gallium/drivers/svga/svga_resource_texture.c
index 49509303553..4feca53df07 100644
--- a/src/gallium/drivers/svga/svga_resource_texture.c
+++ b/src/gallium/drivers/svga/svga_resource_texture.c
@@ -258,7 +258,6 @@ svga_texture_transfer_map(struct pipe_context *pipe,
if (usage & PIPE_TRANSFER_MAP_DIRECTLY)
return NULL;
- assert(box->depth == 1);
st = CALLOC_STRUCT(svga_transfer);
if (!st)
return NULL;
@@ -268,19 +267,19 @@ svga_texture_transfer_map(struct pipe_context *pipe,
st->base.usage = usage;
st->base.box = *box;
st->base.stride = nblocksx*util_format_get_blocksize(texture->format);
- st->base.layer_stride = 0;
+ st->base.layer_stride = st->base.stride * nblocksy;
st->hw_nblocksy = nblocksy;
st->hwbuf = svga_winsys_buffer_create(svga,
1,
0,
- st->hw_nblocksy*st->base.stride);
+ st->hw_nblocksy * st->base.stride * box->depth);
while(!st->hwbuf && (st->hw_nblocksy /= 2)) {
st->hwbuf = svga_winsys_buffer_create(svga,
1,
0,
- st->hw_nblocksy*st->base.stride);
+ st->hw_nblocksy * st->base.stride * box->depth);
}
if(!st->hwbuf)