aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstore.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-11-28 08:38:39 +0100
committermarha <marha@users.sourceforge.net>2011-11-28 08:38:39 +0100
commit22fb212bb84a69ab20a494aed1c197da1d2dbdf7 (patch)
treed11c21c9260bee0f56c34ee6e241671befd5257f /mesalib/src/mesa/main/texstore.c
parentc1296df0ebe19a8e90fb7d7f0135d7034f16a76d (diff)
parent7417e9a171736b5279881cd4381fb58c617a23d9 (diff)
downloadvcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.tar.gz
vcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.tar.bz2
vcxsrv-22fb212bb84a69ab20a494aed1c197da1d2dbdf7.zip
Merge remote-tracking branch 'origin/released'
Diffstat (limited to 'mesalib/src/mesa/main/texstore.c')
-rw-r--r--mesalib/src/mesa/main/texstore.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c
index aae6b4b3b..6deeb642e 100644
--- a/mesalib/src/mesa/main/texstore.c
+++ b/mesalib/src/mesa/main/texstore.c
@@ -1265,12 +1265,15 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
const GLenum baseFormat = _mesa_get_format_base_format(dstFormat);
ASSERT(dstFormat == MESA_FORMAT_RGBA8888 ||
- dstFormat == MESA_FORMAT_RGBA8888_REV);
+ dstFormat == MESA_FORMAT_RGBA8888_REV ||
+ dstFormat == MESA_FORMAT_RGBX8888 ||
+ dstFormat == MESA_FORMAT_RGBX8888_REV);
ASSERT(texelBytes == 4);
if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_RGBA8888 &&
+ (dstFormat == MESA_FORMAT_RGBA8888 ||
+ dstFormat == MESA_FORMAT_RGBX8888) &&
baseInternalFormat == GL_RGBA &&
((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) ||
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) ||
@@ -1285,7 +1288,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
}
else if (!ctx->_ImageTransferState &&
!srcPacking->SwapBytes &&
- dstFormat == MESA_FORMAT_RGBA8888_REV &&
+ (dstFormat == MESA_FORMAT_RGBA8888_REV ||
+ dstFormat == MESA_FORMAT_RGBX8888_REV) &&
baseInternalFormat == GL_RGBA &&
((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) ||
(srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) ||
@@ -1309,8 +1313,10 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
/* dstmap - how to swizzle from RGBA to dst format:
*/
- if ((littleEndian && dstFormat == MESA_FORMAT_RGBA8888) ||
- (!littleEndian && dstFormat == MESA_FORMAT_RGBA8888_REV)) {
+ if ((littleEndian && (dstFormat == MESA_FORMAT_RGBA8888 ||
+ dstFormat == MESA_FORMAT_RGBX8888)) ||
+ (!littleEndian && (dstFormat == MESA_FORMAT_RGBA8888_REV ||
+ dstFormat == MESA_FORMAT_RGBX8888_REV))) {
dstmap[3] = 0;
dstmap[2] = 1;
dstmap[1] = 2;
@@ -1351,7 +1357,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS)
+ dstXoffset * texelBytes;
for (row = 0; row < srcHeight; row++) {
GLuint *dstUI = (GLuint *) dstRow;
- if (dstFormat == MESA_FORMAT_RGBA8888) {
+ if (dstFormat == MESA_FORMAT_RGBA8888 ||
+ dstFormat == MESA_FORMAT_RGBX8888) {
for (col = 0; col < srcWidth; col++) {
dstUI[col] = PACK_COLOR_8888( src[RCOMP],
src[GCOMP],
@@ -4281,6 +4288,8 @@ _mesa_get_texstore_func(gl_format format)
table[MESA_FORMAT_RGBA8888_REV] = _mesa_texstore_rgba8888;
table[MESA_FORMAT_ARGB8888] = _mesa_texstore_argb8888;
table[MESA_FORMAT_ARGB8888_REV] = _mesa_texstore_argb8888;
+ table[MESA_FORMAT_RGBX8888] = _mesa_texstore_rgba8888;
+ table[MESA_FORMAT_RGBX8888_REV] = _mesa_texstore_rgba8888;
table[MESA_FORMAT_XRGB8888] = _mesa_texstore_argb8888;
table[MESA_FORMAT_XRGB8888_REV] = _mesa_texstore_argb8888;
table[MESA_FORMAT_RGB888] = _mesa_texstore_rgb888;