mesa/format_pack: Fix pack_uint_Z_FLOAT32()

Submitted by Illia Iorin on Sept. 13, 2018, 9:31 a.m.

Details

Message ID 20180913093100.6154-1-illia.iorin@gloaballogic.com
State New
Headers show
Series "mesa/format_pack: Fix pack_uint_Z_FLOAT32()" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Illia Iorin Sept. 13, 2018, 9:31 a.m.
Fixed pack_uint_Z_FLOAT32 by casting row data to float instead uint.
Remove code duplicate function pack_uint_Z_FLOAT32_X24S8.
Edited case in "_mesa_get_pack_uint_z_func".
Now it looks like "_mesa_get_pack_float_z_func".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91433
Signed-off-by: Illia Iorin <illia.iorin@globallogic.com>
---
 src/mesa/main/format_pack.py | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/mesa/main/format_pack.py b/src/mesa/main/format_pack.py
index 0b9e0d424d..a1774212c4 100644
--- a/src/mesa/main/format_pack.py
+++ b/src/mesa/main/format_pack.py
@@ -592,16 +592,6 @@  pack_uint_Z_FLOAT32(const GLuint *src, void *dst)
    assert(*d <= 1.0f);
 }
 
-static void
-pack_uint_Z_FLOAT32_X24S8(const GLuint *src, void *dst)
-{
-   GLfloat *d = ((GLfloat *) dst);
-   const GLdouble scale = 1.0 / (GLdouble) 0xffffffff;
-   *d = (GLfloat) (*src * scale);
-   assert(*d >= 0.0f);
-   assert(*d <= 1.0f);
-}
-
 gl_pack_uint_z_func
 _mesa_get_pack_uint_z_func(mesa_format format)
 {
@@ -617,9 +607,8 @@  _mesa_get_pack_uint_z_func(mesa_format format)
    case MESA_FORMAT_Z_UNORM32:
       return pack_uint_Z_UNORM32;
    case MESA_FORMAT_Z_FLOAT32:
-      return pack_uint_Z_FLOAT32;
    case MESA_FORMAT_Z32_FLOAT_S8X24_UINT:
-      return pack_uint_Z_FLOAT32_X24S8;
+      return pack_uint_Z_FLOAT32;
    default:
       _mesa_problem(NULL, "unexpected format in _mesa_get_pack_uint_z_func()");
       return NULL;