summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/formats.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-09-27 20:40:53 -0600
committerBrian Paul <[email protected]>2009-09-27 20:40:53 -0600
commit5978cbdf7728df7952c9c04165ece23394a5fb95 (patch)
tree36ee5655e97670c8e00a7db2d59b345b35e7d3c2 /src/mesa/main/formats.c
parentddffe4546a81216cde4376ee49cbaa021f4d04bb (diff)
mesa: code movement
Diffstat (limited to 'src/mesa/main/formats.c')
-rw-r--r--src/mesa/main/formats.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
index afa2398ed41..2ad5685883e 100644
--- a/src/mesa/main/formats.c
+++ b/src/mesa/main/formats.c
@@ -594,6 +594,45 @@ _mesa_get_format_bytes(gl_format format)
}
+GLint
+_mesa_get_format_bits(gl_format format, GLenum pname)
+{
+ const struct gl_format_info *info = _mesa_get_format_info(format);
+
+ switch (pname) {
+ case GL_TEXTURE_RED_SIZE:
+ return info->RedBits;
+ case GL_TEXTURE_GREEN_SIZE:
+ return info->GreenBits;
+ case GL_TEXTURE_BLUE_SIZE:
+ return info->BlueBits;
+ case GL_TEXTURE_ALPHA_SIZE:
+ return info->AlphaBits;
+ case GL_TEXTURE_INTENSITY_SIZE:
+ return info->IntensityBits;
+ case GL_TEXTURE_LUMINANCE_SIZE:
+ return info->LuminanceBits;
+ case GL_TEXTURE_INDEX_SIZE_EXT:
+ return info->IndexBits;
+ case GL_TEXTURE_DEPTH_SIZE_ARB:
+ return info->DepthBits;
+ case GL_TEXTURE_STENCIL_SIZE_EXT:
+ return info->StencilBits;
+ default:
+ _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()");
+ return 0;
+ }
+}
+
+
+GLenum
+_mesa_get_format_datatype(gl_format format)
+{
+ const struct gl_format_info *info = _mesa_get_format_info(format);
+ return info->DataType;
+}
+
+
GLenum
_mesa_get_format_base_format(gl_format format)
{
@@ -785,42 +824,3 @@ _mesa_format_to_type_and_comps2(gl_format format,
*datatype = GL_UNSIGNED_BYTE;
}
}
-
-
-GLint
-_mesa_get_format_bits(gl_format format, GLenum pname)
-{
- const struct gl_format_info *info = _mesa_get_format_info(format);
-
- switch (pname) {
- case GL_TEXTURE_RED_SIZE:
- return info->RedBits;
- case GL_TEXTURE_GREEN_SIZE:
- return info->GreenBits;
- case GL_TEXTURE_BLUE_SIZE:
- return info->BlueBits;
- case GL_TEXTURE_ALPHA_SIZE:
- return info->AlphaBits;
- case GL_TEXTURE_INTENSITY_SIZE:
- return info->IntensityBits;
- case GL_TEXTURE_LUMINANCE_SIZE:
- return info->LuminanceBits;
- case GL_TEXTURE_INDEX_SIZE_EXT:
- return info->IndexBits;
- case GL_TEXTURE_DEPTH_SIZE_ARB:
- return info->DepthBits;
- case GL_TEXTURE_STENCIL_SIZE_EXT:
- return info->StencilBits;
- default:
- _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()");
- return 0;
- }
-}
-
-
-GLenum
-_mesa_get_format_datatype(gl_format format)
-{
- const struct gl_format_info *info = _mesa_get_format_info(format);
- return info->DataType;
-}