diff --git a/src/gallium/drivers/asahi/agx_pipe.c b/src/gallium/drivers/asahi/agx_pipe.c index d465979a3e1..52f38027428 100644 --- a/src/gallium/drivers/asahi/agx_pipe.c +++ b/src/gallium/drivers/asahi/agx_pipe.c @@ -300,6 +300,7 @@ agx_linear_allowed(const struct agx_resource *pres) * works for 2D textures. Rectangle textures are a special case of 2D. */ case PIPE_TEXTURE_2D: + case PIPE_TEXTURE_2D_ARRAY: case PIPE_TEXTURE_RECT: break; diff --git a/src/gallium/drivers/asahi/agx_state.c b/src/gallium/drivers/asahi/agx_state.c index a78bb10adbd..e755ac36b20 100644 --- a/src/gallium/drivers/asahi/agx_state.c +++ b/src/gallium/drivers/asahi/agx_state.c @@ -587,9 +587,8 @@ agx_pack_texture(void *out, struct agx_resource *rsrc, util_format_compose_swizzles(format_swizzle, view_swizzle, out_swizzle); - /* Must tile array textures */ - assert((rsrc->layout.tiling != AIL_TILING_LINEAR) || - (state->u.tex.last_layer == state->u.tex.first_layer)); + unsigned first_layer = + (state->target == PIPE_BUFFER) ? 0 : state->u.tex.first_layer; /* Pack the descriptor into GPU memory */ agx_pack(out, TEXTURE, cfg) { @@ -635,7 +634,15 @@ agx_pack_texture(void *out, struct agx_resource *rsrc, (state->target == PIPE_TEXTURE_CUBE_ARRAY)) layers /= 6; - cfg.depth = layers; + if (rsrc->layout.tiling == AIL_TILING_LINEAR && + state->target == PIPE_TEXTURE_2D_ARRAY) { + cfg.depth_linear = layers; + cfg.layer_stride_linear = (rsrc->layout.layer_stride_B - 0x80); + cfg.extended = true; + } else { + assert((rsrc->layout.tiling != AIL_TILING_LINEAR) || (layers == 1)); + cfg.depth = layers; + } } if (rsrc->base.nr_samples > 1)