Mesa (master): mesa: Add _mesa_is_array_texture helper

Iago Toral Quiroga itoral at kemper.freedesktop.org
Tue Feb 24 08:01:17 UTC 2015


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Tue Feb 10 16:40:43 2015 +0100

mesa: Add _mesa_is_array_texture helper

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/mesa/main/teximage.c |   22 ++++++++++++++++++++++
 src/mesa/main/teximage.h |    3 +++
 2 files changed, 25 insertions(+)

diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index c65d6ab..81a3f15 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -739,6 +739,28 @@ _mesa_is_proxy_texture(GLenum target)
 
 
 /**
+ * Test if a target is an array target.
+ *
+ * \param target texture target.
+ *
+ * \return true if the target is an array target, false otherwise.
+ */
+bool
+_mesa_is_array_texture(GLenum target)
+{
+   switch (target) {
+   case GL_TEXTURE_1D_ARRAY:
+   case GL_TEXTURE_2D_ARRAY:
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+   case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
+      return true;
+   default:
+      return false;
+   };
+}
+
+
+/**
  * Return the proxy target which corresponds to the given texture target
  */
 static GLenum
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 02b0eda..b7336bc 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -66,6 +66,9 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat );
 extern GLboolean
 _mesa_is_proxy_texture(GLenum target);
 
+extern bool
+_mesa_is_array_texture(GLenum target);
+
 extern struct gl_texture_image *
 _mesa_new_texture_image( struct gl_context *ctx );
 




More information about the mesa-commit mailing list