summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-12-02 14:56:56 +0100
committerJakob Bornecrantz <[email protected]>2009-12-02 14:56:56 +0100
commitcc8a537c57a62a196106b592e510e4c93bd1826e (patch)
tree626155e23277d9660c0a1787a94b63d969e93c6d /src/mesa/main
parent7fc75ef7d43038385b5fba73a67f1e4783b045d6 (diff)
parent0c75854cc1650dc870e042aa66a053e70b3d4556 (diff)
Merge branch 'mesa_7_7_branch'
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/texfetch_tmp.h2
-rw-r--r--src/mesa/main/texstore.c20
2 files changed, 13 insertions, 9 deletions
diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h
index 1f0d4362361..e6772c89f36 100644
--- a/src/mesa/main/texfetch_tmp.h
+++ b/src/mesa/main/texfetch_tmp.h
@@ -864,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage,
static void FETCH(f_al1616)( const struct gl_texture_image *texImage,
GLint i, GLint j, GLint k, GLfloat *texel )
{
- const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
+ const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1);
texel[RCOMP] =
texel[GCOMP] =
texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff );
diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c
index 5387eb12837..792c83141ec 100644
--- a/src/mesa/main/texstore.c
+++ b/src/mesa/main/texstore.c
@@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS)
GLuint *dstUI = (GLuint *) dstRow;
if (dstFormat == MESA_FORMAT_AL1616) {
for (col = 0; col < srcWidth; col++) {
- /* src[0] is luminance, src[1] is alpha */
- dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]),
- FLOAT_TO_USHORT(src[0]) );
- src += 2;
+ GLushort l, a;
+
+ UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
+ UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
+ dstUI[col] = PACK_COLOR_1616(a, l);
+ src += 2;
}
}
else {
for (col = 0; col < srcWidth; col++) {
- /* src[0] is luminance, src[1] is alpha */
- dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]),
- FLOAT_TO_UBYTE(src[0]) );
- src += 2;
+ GLushort l, a;
+
+ UNCLAMPED_FLOAT_TO_USHORT(l, src[0]);
+ UNCLAMPED_FLOAT_TO_USHORT(a, src[1]);
+ dstUI[col] = PACK_COLOR_1616_REV(a, l);
+ src += 2;
}
}
dstRow += dstRowStride;