mesa/texformat: add _mesa_tex_target_is_array function 36/6836/1
authorJordan Justen <jordan.l.justen@intel.com>
Wed, 17 Apr 2013 23:30:59 +0000 (16:30 -0700)
committerJordan Justen <jordan.l.justen@intel.com>
Mon, 3 Jun 2013 03:39:38 +0000 (20:39 -0700)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/texformat.c
src/mesa/main/texformat.h

index 241e2bf..495a204 100644 (file)
@@ -820,3 +820,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
                  _mesa_lookup_enum_by_nr(internalFormat));
    return MESA_FORMAT_NONE;
 }
+
+GLboolean
+_mesa_tex_target_is_array(GLenum target)
+{
+   switch (target) {
+   case GL_TEXTURE_1D_ARRAY_EXT:
+   case GL_TEXTURE_2D_ARRAY_EXT:
+   case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+      return GL_TRUE;
+   default:
+      return GL_FALSE;
+   }
+}
index efe2699..d6ff541 100644 (file)
@@ -36,5 +36,7 @@ extern gl_format
 _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
                         GLint internalFormat, GLenum format, GLenum type);
 
+extern GLboolean
+_mesa_tex_target_is_array(GLenum target);
 
 #endif