summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texparam.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-11-23 15:33:46 -0700
committerBrian Paul <brianp@vmware.com>2011-11-28 08:07:32 -0700
commit37bf720da4a165c3fbf22d8ebb87c5c42e02f98e (patch)
tree1004dc293d17d6f48d31c6a4c289c3ce3740b662 /src/mesa/main/texparam.c
parentd45c9b239fdc2a2e06e14fc94c118f27d4011024 (diff)
mesa: move _mesa_base_format_has_channel() into image.c
This is where other format-related functions live. Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/main/texparam.c')
-rw-r--r--src/mesa/main/texparam.c84
1 files changed, 1 insertions, 83 deletions
diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c
index 99a4b432b41..f4ec6338866 100644
--- a/src/mesa/main/texparam.c
+++ b/src/mesa/main/texparam.c
@@ -35,6 +35,7 @@
#include "main/context.h"
#include "main/enums.h"
#include "main/formats.h"
+#include "main/image.h"
#include "main/macros.h"
#include "main/mfeatures.h"
#include "main/mtypes.h"
@@ -884,89 +885,6 @@ _mesa_TexParameterIuiv(GLenum target, GLenum pname, const GLuint *params)
}
-GLboolean
-_mesa_base_format_has_channel(GLenum base_format, GLenum pname)
-{
- switch (pname) {
- case GL_TEXTURE_RED_SIZE:
- case GL_TEXTURE_RED_TYPE:
- case GL_RENDERBUFFER_RED_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE:
- if (base_format == GL_RED ||
- base_format == GL_RG ||
- base_format == GL_RGB ||
- base_format == GL_RGBA) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_GREEN_SIZE:
- case GL_TEXTURE_GREEN_TYPE:
- case GL_RENDERBUFFER_GREEN_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE:
- if (base_format == GL_RG ||
- base_format == GL_RGB ||
- base_format == GL_RGBA) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_BLUE_SIZE:
- case GL_TEXTURE_BLUE_TYPE:
- case GL_RENDERBUFFER_BLUE_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE:
- if (base_format == GL_RGB ||
- base_format == GL_RGBA) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_ALPHA_SIZE:
- case GL_TEXTURE_ALPHA_TYPE:
- case GL_RENDERBUFFER_ALPHA_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE:
- if (base_format == GL_RGBA ||
- base_format == GL_ALPHA ||
- base_format == GL_LUMINANCE_ALPHA) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_LUMINANCE_SIZE:
- case GL_TEXTURE_LUMINANCE_TYPE:
- if (base_format == GL_LUMINANCE ||
- base_format == GL_LUMINANCE_ALPHA) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_INTENSITY_SIZE:
- case GL_TEXTURE_INTENSITY_TYPE:
- if (base_format == GL_INTENSITY) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_TEXTURE_DEPTH_SIZE:
- case GL_TEXTURE_DEPTH_TYPE:
- case GL_RENDERBUFFER_DEPTH_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE:
- if (base_format == GL_DEPTH_STENCIL ||
- base_format == GL_DEPTH_COMPONENT) {
- return GL_TRUE;
- }
- return GL_FALSE;
- case GL_RENDERBUFFER_STENCIL_SIZE_EXT:
- case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE:
- if (base_format == GL_DEPTH_STENCIL ||
- base_format == GL_STENCIL_INDEX) {
- return GL_TRUE;
- }
- return GL_FALSE;
- default:
- _mesa_warning(NULL, "%s: Unexpected channel token 0x%x\n",
- __FUNCTION__, pname);
- return GL_FALSE;
- }
-
- return GL_FALSE;
-}
-
-
void GLAPIENTRY
_mesa_GetTexLevelParameterfv( GLenum target, GLint level,
GLenum pname, GLfloat *params )