mesa/teximage: add _mesa_is_cube_map_texture utility method
authorEduardo Lima Mitev <elima@igalia.com>
Tue, 12 Jan 2016 18:36:20 +0000 (19:36 +0100)
committerEduardo Lima Mitev <elima@igalia.com>
Thu, 3 Mar 2016 14:14:06 +0000 (15:14 +0100)
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/teximage.c
src/mesa/main/teximage.h

index 78d5b55e6819770567b953006437240db837ba03..616a92953e73adf7837e03da113eca7165401d70 100644 (file)
@@ -242,6 +242,24 @@ _mesa_is_array_texture(GLenum target)
    };
 }
 
+/**
+ * Test if a target is a cube map.
+ *
+ * \param target texture target.
+ *
+ * \return true if the target is a cube map, false otherwise.
+ */
+bool
+_mesa_is_cube_map_texture(GLenum target)
+{
+   switch(target) {
+   case GL_TEXTURE_CUBE_MAP:
+   case GL_TEXTURE_CUBE_MAP_ARRAY:
+      return true;
+   default:
+      return false;
+   }
+}
 
 /**
  * Return the proxy target which corresponds to the given texture target
index 5a29c6c687d48bdc0ad131a2ed2b09ef873ee7cc..8b687062a67948c5e9be739aa986fde5ccfe26ca 100644 (file)
@@ -256,6 +256,10 @@ _mesa_texture_buffer_range(struct gl_context *ctx,
                            struct gl_buffer_object *bufObj,
                            GLintptr offset, GLsizeiptr size,
                            const char *caller);
+
+bool
+_mesa_is_cube_map_texture(GLenum target);
+
 /*@}*/