[Mesa-dev] [PATCH] mesa/format_pack: Fix pack_uint_Z_FLOAT32()
Illia Iorin
illia.iorin at gmail.com
Thu Sep 13 09:31:00 UTC 2018
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 at globallogic.com>
---
src/mesa/main/format_pack.py | 13 +------------
1 file changed, 1 insertion(+), 12 deletions(-)
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;
--
2.17.1
More information about the mesa-dev
mailing list