Mesa (master): st/mesa: use the correct src format in ReadPixels

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jan 13 09:02:36 UTC 2021


Module: Mesa
Branch: master
Commit: 8ecace073ea68e3819ea7c5637bd479067e1420b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ecace073ea68e3819ea7c5637bd479067e1420b

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
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 <gert.wollny at collabora.com>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8387>

---

 src/mesa/state_tracker/st_cb_readpixels.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c
index 1fd84b02420..65cf3b0c7a4 100644
--- a/src/mesa/state_tracker/st_cb_readpixels.c
+++ b/src/mesa/state_tracker/st_cb_readpixels.c
@@ -452,7 +452,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);
 



More information about the mesa-commit mailing list