mesa: update fallthrough comment so gcc can see it
[mesa.git] / src / mesa / main / texstore.h
index fbb3b2668e7cce2fa1a655ef39d43799d479654f..9d735d16c707fd05ea83fd421a1fe946e22415e3 100644 (file)
 #define TEXSTORE_H
 
 
-#include "mtypes.h"
+#include "glheader.h"
 #include "formats.h"
+#include "util/macros.h"
 
+struct gl_context;
+struct gl_pixelstore_attrib;
+struct gl_texture_image;
 
 /**
  * This macro defines the (many) parameters to the texstore functions.
@@ -56,8 +60,8 @@
  */
 #define TEXSTORE_PARAMS \
        struct gl_context *ctx, GLuint dims, \
-       GLenum baseInternalFormat, \
-       gl_format dstFormat, \
+        UNUSED GLenum baseInternalFormat, \
+        UNUSED mesa_format dstFormat, \
         GLint dstRowStride, \
         GLubyte **dstSlices, \
        GLint srcWidth, GLint srcHeight, GLint srcDepth, \
        const GLvoid *srcAddr, \
        const struct gl_pixelstore_attrib *srcPacking
 
+/* This macro must be kept in sync with TEXSTORE_PARAMS.  It is used in the
+ * few places where none of the parameters are used (i.e., the ETC texstore
+ * functions).
+ */
+#define UNUSED_TEXSTORE_PARAMS                                          \
+        UNUSED struct gl_context *ctx, UNUSED GLuint dims,              \
+        UNUSED GLenum baseInternalFormat,                               \
+        UNUSED mesa_format dstFormat,                                   \
+        UNUSED GLint dstRowStride,                                      \
+        UNUSED GLubyte **dstSlices,                                     \
+        UNUSED GLint srcWidth, UNUSED GLint srcHeight, UNUSED GLint srcDepth, \
+        UNUSED GLenum srcFormat, UNUSED GLenum srcType,                 \
+        UNUSED const GLvoid *srcAddr,                                   \
+        UNUSED const struct gl_pixelstore_attrib *srcPacking
 
 extern GLboolean
 _mesa_texstore(TEXSTORE_PARAMS);
@@ -72,34 +90,26 @@ _mesa_texstore(TEXSTORE_PARAMS);
 extern GLboolean
 _mesa_texstore_needs_transfer_ops(struct gl_context *ctx,
                                   GLenum baseInternalFormat,
-                                  gl_format dstFormat);
+                                  mesa_format dstFormat);
+
+extern void
+_mesa_memcpy_texture(struct gl_context *ctx,
+                     GLuint dimensions,
+                     mesa_format dstFormat,
+                     GLint dstRowStride,
+                     GLubyte **dstSlices,
+                     GLint srcWidth, GLint srcHeight, GLint srcDepth,
+                     GLenum srcFormat, GLenum srcType,
+                     const GLvoid *srcAddr,
+                     const struct gl_pixelstore_attrib *srcPacking);
 
 extern GLboolean
 _mesa_texstore_can_use_memcpy(struct gl_context *ctx,
-                              GLenum baseInternalFormat, gl_format dstFormat,
+                              GLenum baseInternalFormat, mesa_format dstFormat,
                               GLenum srcFormat, GLenum srcType,
                               const struct gl_pixelstore_attrib *srcPacking);
 
 
-extern GLubyte *
-_mesa_make_temp_ubyte_image(struct gl_context *ctx, GLuint dims,
-                           GLenum logicalBaseFormat,
-                           GLenum textureBaseFormat,
-                           GLint srcWidth, GLint srcHeight, GLint srcDepth,
-                           GLenum srcFormat, GLenum srcType,
-                           const GLvoid *srcAddr,
-                           const struct gl_pixelstore_attrib *srcPacking);
-
-GLfloat *
-_mesa_make_temp_float_image(struct gl_context *ctx, GLuint dims,
-                           GLenum logicalBaseFormat,
-                           GLenum textureBaseFormat,
-                           GLint srcWidth, GLint srcHeight, GLint srcDepth,
-                           GLenum srcFormat, GLenum srcType,
-                           const GLvoid *srcAddr,
-                           const struct gl_pixelstore_attrib *srcPacking,
-                           GLbitfield transferOps);
-
 extern void
 _mesa_store_teximage(struct gl_context *ctx,
                      GLuint dims,
@@ -117,6 +127,13 @@ _mesa_store_texsubimage(struct gl_context *ctx, GLuint dims,
                         const struct gl_pixelstore_attrib *packing);
 
 
+extern void
+_mesa_store_cleartexsubimage(struct gl_context *ctx,
+                             struct gl_texture_image *texImage,
+                             GLint xoffset, GLint yoffset, GLint zoffset,
+                             GLsizei width, GLsizei height, GLsizei depth,
+                             const GLvoid *clearValue);
+
 extern void
 _mesa_store_compressed_teximage(struct gl_context *ctx, GLuint dims,
                                 struct gl_texture_image *texImage,
@@ -132,4 +149,22 @@ _mesa_store_compressed_texsubimage(struct gl_context *ctx, GLuint dims,
                                    GLsizei imageSize, const GLvoid *data);
 
 
+struct compressed_pixelstore {
+   int SkipBytes;
+   int CopyBytesPerRow;
+   int CopyRowsPerSlice;
+   int TotalBytesPerRow;
+   int TotalRowsPerSlice;
+   int CopySlices;
+};
+
+
+extern void
+_mesa_compute_compressed_pixelstore(GLuint dims, mesa_format texFormat,
+                                    GLsizei width, GLsizei height,
+                                    GLsizei depth,
+                                    const struct gl_pixelstore_attrib *packing,
+                                    struct compressed_pixelstore *store);
+
+
 #endif