mesa: Fold _mesa_unpack_depth_stencil_row() into its only caller.
authorEric Anholt <eric@anholt.net>
Mon, 1 Jul 2019 23:45:32 +0000 (16:45 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Jul 2019 19:51:13 +0000 (12:51 -0700)
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>
src/mesa/main/format_unpack.h
src/mesa/main/format_unpack.py
src/mesa/main/texgetimage.c

index 4d09c76782251a11e5c79560b979770be311a8e7..4de0cc267e26e726fc7bc29dcb9bde9a1387a333 100644 (file)
@@ -67,8 +67,5 @@ _mesa_unpack_float_32_uint_24_8_depth_stencil_row(mesa_format format,
                                                   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 */
index 54df8efb7ced94f052e48736f65f2ce00ae3dfb6..e3c86bbf4bcc6301658aecb83570f4ca70d6f2b4 100644 (file)
@@ -844,30 +844,6 @@ _mesa_unpack_float_32_uint_24_8_depth_stencil_row(mesa_format format, uint32_t n
    }
 }
 
-/**
- * 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']);
index bb4f7006618d44487ac2a40c36d54ed60448fcb9..15c4ce00178ae585c19e11cff9e8abfdfeaf4deb 100644 (file)
@@ -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);
             }