This was the last bit of gl.h usage in format packing.
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
uint32_t n,
const void *src,
uint32_t *dst);
-void
-_mesa_unpack_depth_stencil_row(mesa_format format, uint32_t n,
- const void *src, GLenum type,
- uint32_t *dst);
+
#endif /* FORMAT_UNPACK_H */
}
}
-/**
- * Unpack depth/stencil
- * \param format the source data format
- * \param type the destination data type
- */
-void
-_mesa_unpack_depth_stencil_row(mesa_format format, uint32_t n,
- const void *src, GLenum type,
- uint32_t *dst)
-{
- assert(type == GL_UNSIGNED_INT_24_8 ||
- type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
-
- switch (type) {
- case GL_UNSIGNED_INT_24_8:
- _mesa_unpack_uint_24_8_depth_stencil_row(format, n, src, dst);
- break;
- case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
- _mesa_unpack_float_32_uint_24_8_depth_stencil_row(format, n, src, dst);
- break;
- default:
- unreachable("bad type 0x%x in _mesa_unpack_depth_stencil_row");
- }
-}
"""
template = Template(string, future_imports=['division']);
GLint img, row;
assert(format == GL_DEPTH_STENCIL);
- assert(type == GL_UNSIGNED_INT_24_8 ||
- type == GL_FLOAT_32_UNSIGNED_INT_24_8_REV);
for (img = 0; img < depth; img++) {
GLubyte *srcMap;
void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels,
width, height, format, type,
img, row, 0);
- _mesa_unpack_depth_stencil_row(texImage->TexFormat,
- width,
- (const GLuint *) src,
- type, dest);
+ switch (type) {
+ case GL_UNSIGNED_INT_24_8:
+ _mesa_unpack_uint_24_8_depth_stencil_row(texImage->TexFormat,
+ width, src, dest);
+ break;
+ case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+ _mesa_unpack_float_32_uint_24_8_depth_stencil_row(texImage->TexFormat,
+ width,
+ src, dest);
+ break;
+ default:
+ unreachable("bad type in get_tex_depth_stencil()");
+ }
if (ctx->Pack.SwapBytes) {
_mesa_swap4((GLuint *) dest, width);
}