summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texgetimage.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-07-01 16:45:32 -0700
committerEric Anholt <[email protected]>2019-07-16 12:51:13 -0700
commitece03848c27675eb4933f07f45acd49336d99144 (patch)
treee3d747e967869e297c970a3ccbf97a58caf7481e /src/mesa/main/texgetimage.c
parent5956b46e1680059c2ee5e0d11cd45b44e46ed607 (diff)
mesa: Fold _mesa_unpack_depth_stencil_row() into its only caller.
This was the last bit of gl.h usage in format packing. Reviewed-by: Thomas Helland <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/mesa/main/texgetimage.c')
-rw-r--r--src/mesa/main/texgetimage.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index bb4f7006618..15c4ce00178 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -132,8 +132,6 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
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;
@@ -150,10 +148,19 @@ get_tex_depth_stencil(struct gl_context *ctx, GLuint dimensions,
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);
}