From abc6432d54c4b4b50368f230634ed8a0d2c92e34 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 May 2016 10:33:18 -0600 Subject: [PATCH] svga: fix copying non-zero layers of 1D array textures Like cube maps, we need to convert the z information to a layer index. Also rename the *_face vars to *_face_layer to make things a little more understandable. Reviewed-by: Charmaine Lee --- src/gallium/drivers/svga/svga_pipe_blit.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/svga/svga_pipe_blit.c b/src/gallium/drivers/svga/svga_pipe_blit.c index 925f972..526018a 100644 --- a/src/gallium/drivers/svga/svga_pipe_blit.c +++ b/src/gallium/drivers/svga/svga_pipe_blit.c @@ -47,7 +47,7 @@ svga_surface_copy(struct pipe_context *pipe, { struct svga_context *svga = svga_context(pipe); struct svga_texture *stex, *dtex; - unsigned dst_face, dst_z, src_face, src_z; + unsigned dst_face_layer, dst_z, src_face_layer, src_z; /* Emit buffered drawing commands, and any back copies. */ @@ -63,38 +63,40 @@ svga_surface_copy(struct pipe_context *pipe, stex = svga_texture(src_tex); dtex = svga_texture(dst_tex); - if (src_tex->target == PIPE_TEXTURE_CUBE) { - src_face = src_box->z; + if (src_tex->target == PIPE_TEXTURE_CUBE || + src_tex->target == PIPE_TEXTURE_1D_ARRAY) { + src_face_layer = src_box->z; src_z = 0; assert(src_box->depth == 1); } else { - src_face = 0; + src_face_layer = 0; src_z = src_box->z; } /* different src/dst type???*/ - if (dst_tex->target == PIPE_TEXTURE_CUBE) { - dst_face = dstz; + if (dst_tex->target == PIPE_TEXTURE_CUBE || + dst_tex->target == PIPE_TEXTURE_1D_ARRAY) { + dst_face_layer = dstz; dst_z = 0; assert(src_box->depth == 1); } else { - dst_face = 0; + dst_face_layer = 0; dst_z = dstz; } svga_texture_copy_handle(svga, stex->handle, src_box->x, src_box->y, src_z, - src_level, src_face, + src_level, src_face_layer, dtex->handle, dstx, dsty, dst_z, - dst_level, dst_face, + dst_level, dst_face_layer, src_box->width, src_box->height, src_box->depth); /* Mark the destination image as being defined */ - svga_define_texture_level(dtex, dst_face, dst_level); + svga_define_texture_level(dtex, dst_face_layer, dst_level); } -- 2.7.4