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

Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Oct 26 12:36:14 2023 -0400

mesa/st/texture: match width+height for texture downloads of cube textures

some drivers require this

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25914>

---

 src/mesa/state_tracker/st_cb_texture.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index f0d0b576152..3b75d012301 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -169,6 +169,11 @@ create_dst_texture(struct gl_context *ctx,
    struct pipe_screen *screen = st->screen;
    struct pipe_resource dst_templ;
 
+   if (pipe_target == PIPE_TEXTURE_CUBE || pipe_target == 
PIPE_TEXTURE_CUBE_ARRAY) {
+      width = MAX2(width, height);
+      height = MAX2(width, height);
+   }
+
    /* create the destination texture of size (width X height X depth) */
    memset(&dst_templ, 0, sizeof(dst_templ));
    dst_templ.target = pipe_target;

Reply via email to