return;
}
}
+
+/**
+ * Unpack depth/stencil
+ * \param format the source data format
+ * \param type the destination data type
+ */
+void
+_mesa_unpack_depth_stencil_row(mesa_format format, GLuint n,
+ const void *src, GLenum type,
+ GLuint *dst)
+{
+ assert(type == GL_UNSIGNED_INT_24_8);
+
+ switch (type) {
+ case GL_UNSIGNED_INT_24_8:
+ _mesa_unpack_uint_24_8_depth_stencil_row(format, n, src, dst);
+ break;
+ default:
+ _mesa_problem(NULL,
+ "bad type 0x%x in _mesa_unpack_depth_stencil_row",
+ type);
+ return;
+ }
+}
_mesa_unpack_uint_24_8_depth_stencil_row(mesa_format format, GLuint n,
const void *src, GLuint *dst);
-
+void
+_mesa_unpack_depth_stencil_row(mesa_format format, GLuint n,
+ const void *src, GLenum type,
+ GLuint *dst);
#endif /* FORMAT_UNPACK_H */
void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels,
width, height, format, type,
img, row, 0);
- /* Unpack from texture's format to GL's z24_s8 layout */
- _mesa_unpack_uint_24_8_depth_stencil_row(texImage->TexFormat,
- width,
- (const GLuint *) src,
- dest);
+ _mesa_unpack_depth_stencil_row(texImage->TexFormat,
+ width,
+ (const GLuint *) src,
+ type, dest);
if (ctx->Pack.SwapBytes) {
_mesa_swap4((GLuint *) dest, width);
}