diff options
author | marha <marha@users.sourceforge.net> | 2011-01-08 19:40:59 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-01-08 19:40:59 +0000 |
commit | 432768f75da13ee5343957df6ce5cd316a62929f (patch) | |
tree | b02a3961540984c3d2caf783a6f0854b9b00f92a /mesalib/src/mesa/main/texstore.c | |
parent | 43b6c9073b8aad1170536ae5c6a5a019617659f1 (diff) | |
download | vcxsrv-432768f75da13ee5343957df6ce5cd316a62929f.tar.gz vcxsrv-432768f75da13ee5343957df6ce5cd316a62929f.tar.bz2 vcxsrv-432768f75da13ee5343957df6ce5cd316a62929f.zip |
xserver mesa libX11 xkbcomp pixman git update 8/1/2011
Diffstat (limited to 'mesalib/src/mesa/main/texstore.c')
-rw-r--r-- | mesalib/src/mesa/main/texstore.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/mesalib/src/mesa/main/texstore.c b/mesalib/src/mesa/main/texstore.c index 8759c33ae..1947d32e6 100644 --- a/mesalib/src/mesa/main/texstore.c +++ b/mesalib/src/mesa/main/texstore.c @@ -58,6 +58,8 @@ #include "image.h"
#include "macros.h"
#include "mipmap.h"
+#include "mfeatures.h"
+#include "mtypes.h"
#include "pack.h"
#include "imports.h"
#include "pack.h"
@@ -2063,13 +2065,14 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS) }
else {
/* general path */
- const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims,
+ const GLfloat *tempImage = make_temp_float_image(ctx, dims,
baseInternalFormat,
baseFormat,
srcWidth, srcHeight, srcDepth,
srcFormat, srcType, srcAddr,
- srcPacking);
- const GLchan *src = tempImage;
+ srcPacking,
+ ctx->_ImageTransferState);
+ const GLfloat *src = tempImage;
GLint img, row, col;
if (!tempImage)
return GL_FALSE;
@@ -2080,24 +2083,29 @@ _mesa_texstore_argb2101010(TEXSTORE_PARAMS) + dstXoffset * texelBytes;
if (baseInternalFormat == GL_RGBA) {
for (row = 0; row < srcHeight; row++) {
- GLuint *dstUS = (GLuint *) dstRow;
+ GLuint *dstUI = (GLuint *) dstRow;
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_2101010( CHAN_TO_UBYTE(src[ACOMP]),
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ GLushort a,r,g,b;
+
+ UNCLAMPED_FLOAT_TO_USHORT(a, src[ACOMP]);
+ 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(a, r, g, b);
src += 4;
}
dstRow += dstRowStride;
}
} else if (baseInternalFormat == GL_RGB) {
for (row = 0; row < srcHeight; row++) {
- GLuint *dstUS = (GLuint *) dstRow;
+ GLuint *dstUI = (GLuint *) dstRow;
for (col = 0; col < srcWidth; col++) {
- dstUS[col] = PACK_COLOR_2101010( 0xff,
- CHAN_TO_UBYTE(src[RCOMP]),
- CHAN_TO_UBYTE(src[GCOMP]),
- CHAN_TO_UBYTE(src[BCOMP]) );
+ 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;
|