From ee669227adff84b9269e45e8b8c6e576ecf8e345 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 29 Apr 2021 18:22:14 +0200 Subject: [PATCH] st/mesa: fix clearing of 1D array textures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit st_gl_texture_dims_to_pipe_dims isn't usable in this case since its API doesn't match the usage so fix up the dimensions manually. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3646 Reviewed-by: Ilia Mirkin Reviewed-by: Marek Olšák Part-of: --- src/mesa/state_tracker/st_cb_texture.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 36cf9a72729..1925e6f194a 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -3290,6 +3290,14 @@ st_ClearTexSubImage(struct gl_context *ctx, u_box_3d(xoffset, yoffset, zoffset + texImage->Face, width, height, depth, &box); + + if (pt->target == PIPE_TEXTURE_1D_ARRAY) { + box.z = box.y; + box.depth = box.height; + box.y = 0; + box.height = 1; + } + if (texObj->Immutable) { /* The texture object has to be consistent (no "loose", per-image * gallium resources). If this texture is a view into another