From 8ecace073ea68e3819ea7c5637bd479067e1420b Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 7 Jan 2021 17:36:03 +0100 Subject: [PATCH] st/mesa: use the correct src format in ReadPixels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Marek Olšák Part-of: --- 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);