mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 04:30:10 +01:00
mesa: Set green, blue channels to zero only for formats with these components
This is an optimization which avoids setting pixel transfer operations when not required. _mesa_ReadPixels falls back to slower path if transfer operations are set. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:
parent
ca4e17e03e
commit
bbbefec732
1 changed files with 10 additions and 3 deletions
|
|
@ -3159,9 +3159,16 @@ decompress_texture_image(struct gl_context *ctx,
|
|||
* returned as red and two-channel texture values are returned as
|
||||
* red/alpha.
|
||||
*/
|
||||
if ((baseTexFormat == GL_LUMINANCE ||
|
||||
baseTexFormat == GL_LUMINANCE_ALPHA ||
|
||||
baseTexFormat == GL_INTENSITY) ||
|
||||
if (((baseTexFormat == GL_LUMINANCE ||
|
||||
baseTexFormat == GL_LUMINANCE_ALPHA ||
|
||||
baseTexFormat == GL_INTENSITY) &&
|
||||
(destBaseFormat == GL_RGBA ||
|
||||
destBaseFormat == GL_RGB ||
|
||||
destBaseFormat == GL_RG ||
|
||||
destBaseFormat == GL_GREEN ||
|
||||
destBaseFormat == GL_BLUE ||
|
||||
destBaseFormat == GL_BGRA ||
|
||||
destBaseFormat == GL_BGR)) ||
|
||||
/* If we're reading back an RGB(A) texture (using glGetTexImage) as
|
||||
* luminance then we need to return L=tex(R).
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue