st/mesa: handle array textures in st_texture_image_copy
authorDave Airlie <airlied@redhat.com>
Sat, 14 Jun 2014 01:04:22 +0000 (03:04 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 18 Jun 2014 22:17:09 +0000 (00:17 +0200)
Marek: also handle cube arrays

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/mesa/state_tracker/st_texture.c

index 92035e8016e9fdc957a066638eac336f974adb20..c14882142206c4a41fc2e696c069773cd04e9bcf 100644 (file)
@@ -394,6 +394,14 @@ st_texture_image_copy(struct pipe_context *pipe,
    src_box.width = width;
    src_box.height = height;
    src_box.depth = 1;
+
+   if (src->target == PIPE_TEXTURE_1D_ARRAY ||
+       src->target == PIPE_TEXTURE_2D_ARRAY ||
+       src->target == PIPE_TEXTURE_CUBE_ARRAY) {
+      face = 0;
+      depth = src->array_size;
+   }
+
    /* Loop over 3D image slices */
    /* could (and probably should) use "true" 3d box here -
       but drivers can't quite handle it yet */