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

Author: Marek Olšák <marek.ol...@amd.com>
Date:   Sun Nov 19 01:52:19 2023 -0500

st/mesa: set pipe_framebuffer_state::layers for PBO blits

It only worked with drivers that ignored it.

Reviewed-by: Qiang Yu <yuq...@gmail.com>
Reviewed-by: Alyssa Rosenzweig <aly...@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26274>

---

 src/mesa/state_tracker/st_cb_readpixels.c | 2 +-
 src/mesa/state_tracker/st_cb_texture.c    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_readpixels.c 
b/src/mesa/state_tracker/st_cb_readpixels.c
index f99140d7d74..f780c640f3f 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -219,7 +219,7 @@ try_pbo_readpixels(struct st_context *st, struct 
gl_renderbuffer *rb,
    fb.width = surface->width;
    fb.height = surface->height;
    fb.samples = 1;
-   fb.layers = 1;
+   fb.layers = addr.depth;
    cso_set_framebuffer(cso, &fb);
 
    /* Any blend state would do. Set this just to prevent drivers having
diff --git a/src/mesa/state_tracker/st_cb_texture.c 
b/src/mesa/state_tracker/st_cb_texture.c
index 3b75d012301..6c9eda1a0b6 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -2014,7 +2014,7 @@ try_pbo_download(struct st_context *st,
    memset(&fb, 0, sizeof(fb));
    fb.width = texture->width0;
    fb.height = texture->height0;
-   fb.layers = 1;
+   fb.layers = addr.depth;
    fb.samples = 1;
    cso_set_framebuffer(cso, &fb);
 

Reply via email to