diff options
author | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-01 16:03:30 +0000 |
---|---|---|
committer | Brian Paul <brian.paul@tungstengraphics.com> | 2005-10-01 16:03:30 +0000 |
commit | 9758ef9e7bcd5fe85f0920d872c378897f546249 (patch) | |
tree | 988b84b85c6abb7d936b165ae15a75f2640715a4 /src | |
parent | 252194d74ef08b940395a2eb1c05415dfd0d6a91 (diff) |
fix broken z24_s8 fetcher
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/main/texformat_tmp.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 92df2775642..a6a9628ea9d 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1222,8 +1222,8 @@ static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, { /* only return Z, not stencil data */ const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 0xffffff; - texel[0] = *src * scale; + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) >> 8) * scale; } #if DIM == 3 @@ -1232,8 +1232,8 @@ static void store_texel_z24_s8(struct gl_texture_image *texImage, { /* only store Z, not stencil */ GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat z = *((GLfloat *) texel); - GLuint zi = ((GLuint) (z * 0xffffff)) << 8; + GLfloat depth = *((GLfloat *) texel); + GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; *dst = zi | (*dst & 0xff); } #endif |