From ee07d0c0bf500d7f250204cb95c15a901b87793d Mon Sep 17 00:00:00 2001 From: Italo Nicola Date: Fri, 18 Jun 2021 07:25:24 -0300 Subject: [PATCH] vrend: bind correct layer for texture arrays in gl blitter For texture arrays, the layer is stored at blit.{src,dst}.box.z. In those cases, we need to go through the same path as we already do for GL_TEXTURE_CUBE_MAP. Fixes piglit's spec@ext_texture_array@copyteximage {1d_array,2d_array}. Tested on both GLES and GL backends. Signed-off-by: Italo Nicola Reviewed-by: Gert Wollny --- src/vrend_blitter.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vrend_blitter.c b/src/vrend_blitter.c index dd4ed83..3469632 100644 --- a/src/vrend_blitter.c +++ b/src/vrend_blitter.c @@ -787,7 +787,9 @@ void vrend_renderer_blit_gl(MAYBE_UNUSED struct vrend_context *ctx, float dst_offset = ((info->src.box.depth - 1) - (info->dst.box.depth - 1) * dst2src_scale) * 0.5; float src_z = (dst_z + dst_offset) * dst2src_scale; - uint32_t layer = (dst_res->target == GL_TEXTURE_CUBE_MAP) ? info->dst.box.z : dst_z; + uint32_t layer = (dst_res->target == GL_TEXTURE_CUBE_MAP || + dst_res->target == GL_TEXTURE_1D_ARRAY || + dst_res->target == GL_TEXTURE_2D_ARRAY) ? info->dst.box.z : dst_z; glBindFramebuffer(GL_FRAMEBUFFER, blit_ctx->fb_id); vrend_fb_bind_texture_id(dst_res, blit_views[1], 0, info->dst.level, layer, 0);