summaryrefslogtreecommitdiff
path: root/src/mesa/swrast/s_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast/s_context.h')
-rw-r--r--src/mesa/swrast/s_context.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/swrast/s_context.h b/src/mesa/swrast/s_context.h
index 6ccee5438e..37d7081d4d 100644
--- a/src/mesa/swrast/s_context.h
+++ b/src/mesa/swrast/s_context.h
@@ -432,6 +432,16 @@ _swrast_validate_derived( GLcontext *ctx );
+/**
+ * Size of an RGBA pixel, in bytes, for given datatype.
+ */
+#define RGBA_PIXEL_SIZE(TYPE) \
+ ((TYPE == GL_UNSIGNED_BYTE) ? 4 * sizeof(GLubyte) : \
+ ((TYPE == GL_UNSIGNED_SHORT) ? 4 * sizeof(GLushort) \
+ : 4 * sizeof(GLfloat)))
+
+
+
/*
* XXX these macros are just bandages for now in order to make
* CHAN_BITS==32 compile cleanly.