mesa/texformat: add _mesa_tex_target_is_array function
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 241e2bfa7fdbf24d8d97c708acaa28136b618de3..495a2048d92f83241efd5c5f6e2d0cd2ce6959f3 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 efe26993ba712959702a1e13da82460a29a54c5b..d6ff54173946f143d39d7b51c7382dbfd0d37776 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