Module: Mesa
Branch: staging/20.3
Commit: 1f211daea13115c9aeca531c6ef3e3e830f0d348
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1f211daea13115c9aeca531c6ef3e3e830f0d348

Author: Pierre-Eric Pelloux-Prayer <[email protected]>
Date:   Thu Jan  7 17:36:03 2021 +0100

st/mesa: use the correct src format in ReadPixels

If reading from an FBO that uses a texture view src->format will
be the format of the original texture, not from the view.

Acked-by: Gert Wollny <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8387>
(cherry picked from commit 8ecace073ea68e3819ea7c5637bd479067e1420b)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 0c55d1631d6..1021e7d578b 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -27904,7 +27904,7 @@
         "description": "st/mesa: use the correct src format in ReadPixels",
         "nominated": false,
         "nomination_type": null,
-        "resolution": 4,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": null
     },
diff --git a/src/mesa/state_tracker/st_cb_readpixels.c 
b/src/mesa/state_tracker/st_cb_readpixels.c
index e2edcbc7604..7ffbe32af22 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -446,7 +446,7 @@ st_ReadPixels(struct gl_context *ctx, GLint x, GLint y,
 
    /* Convert the source format to what is expected by ReadPixels
     * and see if it's supported. */
-   src_format = util_format_linear(src->format);
+   src_format = util_format_linear(strb->Base.Format);
    src_format = util_format_luminance_to_red(src_format);
    src_format = util_format_intensity_to_red(src_format);
 

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to