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 <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Jordan Justen 2012-12-30 00:40:00 -08:00
parent 80784066cc
commit 8443b59a5b
1 changed files with 10 additions and 2 deletions

View File

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