summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-09-13 13:30:17 -0600
committerBrian Paul <brianp@vmware.com>2011-09-18 11:24:04 -0600
commit63b59027563be933f86635489e70520b566360eb (patch)
tree9fd17a22e672cfc8a5e4920f4ee2c10c51502ce8
parent6dd284f7c8fac22f64c13fdf9909094f5ec59086 (diff)
downloadexternal_mesa3d-63b59027563be933f86635489e70520b566360eb.zip
external_mesa3d-63b59027563be933f86635489e70520b566360eb.tar.gz
external_mesa3d-63b59027563be933f86635489e70520b566360eb.tar.bz2
swrast: fix more store_texel() bugs
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=40412 on swrast.
-rw-r--r--src/mesa/swrast/s_texfetch_tmp.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/swrast/s_texfetch_tmp.h b/src/mesa/swrast/s_texfetch_tmp.h
index 0a06dcb..3eebd13 100644
--- a/src/mesa/swrast/s_texfetch_tmp.h
+++ b/src/mesa/swrast/s_texfetch_tmp.h
@@ -1343,9 +1343,9 @@ static void FETCH(f_l16)( const struct swrast_texture_image *texImage,
static void store_texel_l16(struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, const void *texel)
{
- const GLushort *rgba = (const GLushort *) texel;
+ const GLchan *rgba = (const GLchan *) texel;
GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
+ *dst = CHAN_TO_USHORT(rgba[RCOMP]);
}
#endif
@@ -1391,9 +1391,9 @@ static void FETCH(f_i16)( const struct swrast_texture_image *texImage,
static void store_texel_i16(struct swrast_texture_image *texImage,
GLint i, GLint j, GLint k, const void *texel)
{
- const GLushort *rgba = (const GLushort *) texel;
+ const GLchan *rgba = (const GLchan *) texel;
GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1);
- *dst = rgba[RCOMP];
+ *dst = CHAN_TO_USHORT(rgba[RCOMP]);
}
#endif