diff --git a/src/mesa/main/format_pack.h b/src/mesa/main/format_pack.h index 1a4e0868a5d..ae5738e5c8f 100644 --- a/src/mesa/main/format_pack.h +++ b/src/mesa/main/format_pack.h @@ -93,10 +93,6 @@ _mesa_pack_ubyte_stencil_row(mesa_format format, uint32_t n, util_format_pack_s_8uint(format, dst, src, n); } -extern void -_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n, - const uint32_t *src, void *dst); - #ifdef __cplusplus } #endif diff --git a/src/mesa/main/format_pack.py b/src/mesa/main/format_pack.py index 30b5e0dc57f..286623b83c0 100644 --- a/src/mesa/main/format_pack.py +++ b/src/mesa/main/format_pack.py @@ -362,45 +362,6 @@ _mesa_get_pack_ubyte_stencil_func(mesa_format format) } -/** - * Incoming Z/stencil values are always in uint_24_8 format. - */ -void -_mesa_pack_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n, - const uint32_t *src, void *dst) -{ - switch (format) { - case MESA_FORMAT_S8_UINT_Z24_UNORM: - memcpy(dst, src, n * sizeof(uint32_t)); - break; - case MESA_FORMAT_Z24_UNORM_S8_UINT: - { - uint32_t *d = ((uint32_t *) dst); - uint32_t i; - for (i = 0; i < n; i++) { - uint32_t s = src[i] << 24; - uint32_t z = src[i] >> 8; - d[i] = s | z; - } - } - break; - case MESA_FORMAT_Z32_FLOAT_S8X24_UINT: - { - const double scale = 1.0 / (double) 0xffffff; - struct z32f_x24s8 *d = (struct z32f_x24s8 *) dst; - uint32_t i; - for (i = 0; i < n; i++) { - float z = (float) ((src[i] >> 8) * scale); - d[i].z = z; - d[i].x24s8 = src[i]; - } - } - break; - default: - unreachable("bad format in _mesa_pack_ubyte_s_row"); - } -} - """ template = Template(string, future_imports=['division']) diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 31c6a6a971a..c4f6f4b7eae 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -556,6 +556,32 @@ draw_rgba_pixels( struct gl_context *ctx, GLint x, GLint y, swrast_render_finish(ctx); } +/** + * Incoming Z/stencil values are always in uint_24_8 format. + */ +static void +pack_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n, + const uint32_t *src, void *dst) +{ + switch (format) { + case MESA_FORMAT_S8_UINT_Z24_UNORM: + memcpy(dst, src, n * sizeof(uint32_t)); + break; + case MESA_FORMAT_Z24_UNORM_S8_UINT: + { + uint32_t *d = ((uint32_t *) dst); + uint32_t i; + for (i = 0; i < n; i++) { + uint32_t s = src[i] << 24; + uint32_t z = src[i] >> 8; + d[i] = s | z; + } + } + break; + default: + unreachable("bad format in _mesa_pack_ubyte_s_row"); + } +} /** * Draw depth+stencil values into a MESA_FORAMT_Z24_S8 or MESA_FORMAT_Z24_UNORM_S8_UINT @@ -584,8 +610,7 @@ fast_draw_depth_stencil(struct gl_context *ctx, GLint x, GLint y, dstRowStride = srb->RowStride; for (i = 0; i < height; i++) { - _mesa_pack_uint_24_8_depth_stencil_row(rb->Format, width, - (const GLuint *) src, dst); + pack_uint_24_8_depth_stencil_row(rb->Format, width, (const GLuint *) src, dst); dst += dstRowStride; src += srcRowStride; }