aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/formats.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-25 17:27:22 +0100
committerMarc Haesen <marc@hc-consult.be>2011-12-25 17:27:22 +0100
commit0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1 (patch)
treed449668fac922e358f442aeb82d0936ca786ed72 /mesalib/src/mesa/main/formats.c
parent0b3f475361d87764004432f541e34bb86af1b9f3 (diff)
downloadvcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.gz
vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.tar.bz2
vcxsrv-0fd2d56b0fc0ce74c5f3e5e23cb26b0d1a075ba1.zip
mesa xkeyboard-config xserver git update 25 dec 2011
Diffstat (limited to 'mesalib/src/mesa/main/formats.c')
-rw-r--r--mesalib/src/mesa/main/formats.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/mesalib/src/mesa/main/formats.c b/mesalib/src/mesa/main/formats.c
index 1f83a5368..cca0014b1 100644
--- a/mesalib/src/mesa/main/formats.c
+++ b/mesalib/src/mesa/main/formats.c
@@ -27,6 +27,7 @@
#include "imports.h"
#include "formats.h"
#include "mfeatures.h"
+#include "macros.h"
/**
@@ -1613,6 +1614,21 @@ _mesa_get_format_bits(gl_format format, GLenum pname)
}
+GLuint
+_mesa_get_format_max_bits(gl_format format)
+{
+ const struct gl_format_info *info = _mesa_get_format_info(format);
+ GLuint max = MAX2(info->RedBits, info->GreenBits);
+ max = MAX2(max, info->BlueBits);
+ max = MAX2(max, info->AlphaBits);
+ max = MAX2(max, info->LuminanceBits);
+ max = MAX2(max, info->IntensityBits);
+ max = MAX2(max, info->DepthBits);
+ max = MAX2(max, info->StencilBits);
+ return max;
+}
+
+
/**
* Return the data type (or more specifically, the data representation)
* for the given format.