Mesa (master): mesa/texformat: add _mesa_tex_target_is_array function

Jordan Justen jljusten at kemper.freedesktop.org
Mon Jun 3 03:53:37 UTC 2013


Module: Mesa
Branch: master
Commit: 6bfd897fc432590ea50231845608239fb1d60114
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6bfd897fc432590ea50231845608239fb1d60114

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Wed Apr 17 16:30:59 2013 -0700

mesa/texformat: add _mesa_tex_target_is_array function

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Paul Berry <stereotype441 at gmail.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/main/texformat.c |   14 ++++++++++++++
 src/mesa/main/texformat.h |    2 ++
 2 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 241e2bf..495a204 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -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;
+   }
+}
diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h
index efe2699..d6ff541 100644
--- a/src/mesa/main/texformat.h
+++ b/src/mesa/main/texformat.h
@@ -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




More information about the mesa-commit mailing list