[Mesa-dev] [PATCH] mesa: use a double in _mesa_pack_float_z_row() for Z32

Brian Paul brianp at vmware.com
Sat Dec 10 10:57:45 PST 2011


Otherwise, 1.0 was converted to zero instead of 0xffffffff.
---
 src/mesa/main/format_pack.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c
index ba23bab..27482d8 100644
--- a/src/mesa/main/format_pack.c
+++ b/src/mesa/main/format_pack.c
@@ -2318,7 +2318,7 @@ _mesa_pack_float_z_row(gl_format format, GLuint n,
    case MESA_FORMAT_Z32:
       {
          GLuint *d = ((GLuint *) dst);
-         const GLfloat scale = (GLfloat) 0xffffffff;
+         const GLdouble scale = (GLdouble) 0xffffffff;
          GLuint i;
          for (i = 0; i < n; i++) {
             d[i] = (GLuint) (src[i] * scale);
-- 
1.7.3.4



More information about the mesa-dev mailing list