aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-01-14 15:26:50 +0100
committermarha <marha@users.sourceforge.net>2013-01-14 15:26:50 +0100
commitc67a0f76ca34e441a817a7cdf261f496f3b3f2d6 (patch)
treec197b74a8c2f076aaa4f5506b90d6ad8e38b52b2 /mesalib/src/mesa/main/texstore.c
parent8d07c58314685d56a0586d0a437b541ea2b92a54 (diff)
parent2a1abdc8fe640583dac90dc316caf2d40b9ee4e2 (diff)
downloadvcxsrv-c67a0f76ca34e441a817a7cdf261f496f3b3f2d6.tar.gz
vcxsrv-c67a0f76ca34e441a817a7cdf261f496f3b3f2d6.tar.bz2
vcxsrv-c67a0f76ca34e441a817a7cdf261f496f3b3f2d6.zip
Merge remote-tracking branch 'origin/released'
* origin/released: libxtrans xwininfo libX11 libXau libXmu libXdmcp mesa mkfontscale xkeyboard-config git update 14 jan 2013 Conflicts: mesalib/src/glsl/glcpp/.gitignore
Diffstat (limited to 'mesalib/src/mesa/main/texstore.c')
-rw-r--r--mesalib/src/mesa/main/texstore.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index 751150937..a5c7712e0 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -1714,18 +1714,20 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
srcPacking,
ctx->_ImageTransferState);
const GLfloat *src = tempImage;
+ const GLushort aMask = (srcFormat == GL_RGB) ? 0xffff : 0;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
for (img = 0; img < srcDepth; img++) {
GLubyte *dstRow = dstSlices[img];
- if (baseInternalFormat == GL_RGBA) {
+ if (baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB) {
for (row = 0; row < srcHeight; row++) {
GLuint *dstUI = (GLuint *) dstRow;
for (col = 0; col < srcWidth; col++) {
GLushort a,r,g,b;
UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]);
+ a = a | aMask;
UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]);
UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]);
UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]);
@@ -1734,20 +1736,6 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS)
}
dstRow += dstRowStride;
}
- } else if (baseInternalFormat == GL_RGB) {
- for (row = 0; row < srcHeight; row++) {
- GLuint *dstUI = (GLuint *) dstRow;
- for (col = 0; col < srcWidth; col++) {
- GLushort r,g,b;
-
- UNCLAMPED_FLOAT_TO_USHORT(r, src[RCOMP]);
- UNCLAMPED_FLOAT_TO_USHORT(g, src[GCOMP]);
- UNCLAMPED_FLOAT_TO_USHORT(b, src[BCOMP]);
- dstUI[col] = PACK_COLOR_2101010_US(0xffff, r, g, b);
- src += 4;
- }
- dstRow += dstRowStride;
- }
} else {
ASSERT(0);
}