u_blitter: add cube map array support.
authorDave Airlie <airlied@gmail.com>
Sat, 3 Nov 2012 10:52:49 +0000 (20:52 +1000)
committerDave Airlie <airlied@redhat.com>
Fri, 9 Nov 2012 00:29:26 +0000 (10:29 +1000)
This adds cube array support to the blitter.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/auxiliary/util/u_blitter.c

index d10ce231c348644f843937123f3d73735aa38e89..5ea6acac71b8b91e4279f8a87bcc5aa9ee89e176 100644 (file)
@@ -647,9 +647,10 @@ static void blitter_set_texcoords(struct blitter_context_priv *ctx,
 
    get_texcoords(src, src_width0, src_height0, x1, y1, x2, y2, coord);
 
-   if (src->texture->target == PIPE_TEXTURE_CUBE) {
+   if (src->texture->target == PIPE_TEXTURE_CUBE ||
+       src->texture->target == PIPE_TEXTURE_CUBE_ARRAY) {
       set_texcoords_in_vertices(coord, &face_coord[0][0], 2);
-      util_map_texcoords2d_onto_cubemap(layer,
+      util_map_texcoords2d_onto_cubemap(layer % 6,
                                         /* pointer, stride in floats */
                                         &face_coord[0][0], 2,
                                         &ctx->vertices[0][1][0], 8);