aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/formats.h
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/main/formats.h')
-rw-r--r--mesalib/src/mesa/main/formats.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/formats.h b/mesalib/src/mesa/main/formats.h
index dc50bc830..457c8abf8 100644
--- a/mesalib/src/mesa/main/formats.h
+++ b/mesalib/src/mesa/main/formats.h
@@ -35,6 +35,7 @@
#include <GL/gl.h>
#include <stdbool.h>
+#include <stdint.h>
#ifdef __cplusplus
@@ -56,6 +57,29 @@ extern "C" {
*/
#define MAX_PIXEL_BYTES 16
+/**
+ * Specifies the layout of a pixel format. See the MESA_FORMAT
+ * documentation below.
+ */
+enum mesa_format_layout {
+ MESA_FORMAT_LAYOUT_ARRAY,
+ MESA_FORMAT_LAYOUT_PACKED,
+ MESA_FORMAT_LAYOUT_OTHER,
+};
+
+/**
+ * An enum representing different possible swizzling values. This is used
+ * to interpret the output of _mesa_get_format_swizzle
+ */
+enum {
+ MESA_FORMAT_SWIZZLE_X = 0,
+ MESA_FORMAT_SWIZZLE_Y = 1,
+ MESA_FORMAT_SWIZZLE_Z = 2,
+ MESA_FORMAT_SWIZZLE_W = 3,
+ MESA_FORMAT_SWIZZLE_ZERO = 4,
+ MESA_FORMAT_SWIZZLE_ONE = 5,
+ MESA_FORMAT_SWIZZLE_NONE = 6,
+};
/**
* Mesa texture/renderbuffer image formats.
@@ -419,6 +443,9 @@ _mesa_get_format_bits(mesa_format format, GLenum pname);
extern GLuint
_mesa_get_format_max_bits(mesa_format format);
+extern enum mesa_format_layout
+_mesa_get_format_layout(mesa_format format);
+
extern GLenum
_mesa_get_format_datatype(mesa_format format);
@@ -428,6 +455,9 @@ _mesa_get_format_base_format(mesa_format format);
extern void
_mesa_get_format_block_size(mesa_format format, GLuint *bw, GLuint *bh);
+extern void
+_mesa_get_format_swizzle(mesa_format format, uint8_t swizzle_out[4]);
+
extern GLboolean
_mesa_is_format_compressed(mesa_format format);