*d = (GLuint) (*src * scale);
}
+/**
+ ** Pack float to Z_FLOAT32 or Z_FLOAT32_X24S8.
+ **/
+
static void
pack_float_Z_FLOAT32(const GLfloat *src, void *dst)
{
*d = *src;
}
-static void
-pack_uint_Z_FLOAT32(const GLuint *src, void *dst)
-{
- GLuint *d = ((GLuint *) dst);
- const GLdouble scale = 1.0 / (GLdouble) 0xffffffff;
- *d = (GLuint) (*src * scale);
- assert(*d >= 0.0f);
- assert(*d <= 1.0f);
-}
+/**
+ ** Pack uint to Z_FLOAT32 or Z_FLOAT32_X24S8.
+ **/
static void
-pack_uint_Z_FLOAT32_X24S8(const GLuint *src, void *dst)
+pack_uint_Z_FLOAT32(const GLuint *src, void *dst)
{
GLfloat *d = ((GLfloat *) dst);
const GLdouble scale = 1.0 / (GLdouble) 0xffffffff;
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;
zBufferVals = zStart;
}
else {
- if (_mesa_get_format_datatype(rb->Format) != GL_UNSIGNED_NORMALIZED) {
- _mesa_problem(ctx, "Incorrectly writing swrast's integer depth "
- "values to %s depth buffer",
- _mesa_get_format_name(rb->Format));
- }
-
/* copy Z buffer values into temp buffer (32-bit Z values) */
zBufferTemp = malloc(count * sizeof(GLuint));
if (!zBufferTemp)