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@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8387>
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2021-01-07 17:36:03 +01:00
parent a6fe1eeb05
commit 8ecace073e

View file

@ -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);