From: Jordan Justen Date: Sun, 30 Dec 2012 08:40:00 +0000 (-0800) Subject: pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8443b59a5bca9d4e5a2f700fc3e181cf634ff2b7;p=mesa.git pack: handle GL_RGB+GL_UNSIGNED_INT_2_10_10_10_REV case For floats, if GL_RGB is the source, then alpha should be set to 1.0F. Signed-off-by: Jordan Justen Reviewed-by: Ian Romanick --- diff --git a/src/mesa/main/pack.c b/src/mesa/main/pack.c index 4f0caa7636c..d6a97b35a11 100644 --- a/src/mesa/main/pack.c +++ b/src/mesa/main/pack.c @@ -3641,7 +3641,11 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], rgba[i][rDst] = ((p ) & 0x3ff) * rs; rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs; rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs; - rgba[i][aDst] = ((p >> 30) ) * as; + if (aSrc < 0) { + rgba[i][aDst] = 1.0F; + } else { + rgba[i][aDst] = (p >> 30) * as; + } } } else { @@ -3652,7 +3656,11 @@ extract_float_rgba(GLuint n, GLfloat rgba[][4], rgba[i][rDst] = ((p ) & 0x3ff) * rs; rgba[i][gDst] = ((p >> 10) & 0x3ff) * gs; rgba[i][bDst] = ((p >> 20) & 0x3ff) * bs; - rgba[i][aDst] = ((p >> 30) ) * as; + if (aSrc < 0) { + rgba[i][aDst] = 1.0F; + } else { + rgba[i][aDst] = (p >> 30) * as; + } } } break;