Mesa (main): st/mesa: fix clearing of 1D array textures

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu May 27 13:23:55 UTC 2021


Module: Mesa
Branch: main
Commit: ee669227adff84b9269e45e8b8c6e576ecf8e345
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ee669227adff84b9269e45e8b8c6e576ecf8e345

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Thu Apr 29 18:22:14 2021 +0200

st/mesa: fix clearing of 1D array textures

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 <imirkin at alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10523>

---

 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



More information about the mesa-commit mailing list