summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.h
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2012-08-21 20:22:27 -0600
committerBrian Paul <brianp@vmware.com>2012-08-24 06:18:41 -0600
commit46751edca9a95baff81771aa69986fa6e2422ed6 (patch)
treec0022e06d939d20f8e2fd48eace419fbebcc9e9b /src/mesa/main/texobj.h
parent8a935d71ff4ded6f3cdd8e06dcd1a5e3de3d3cc0 (diff)
downloadexternal_mesa3d-46751edca9a95baff81771aa69986fa6e2422ed6.zip
external_mesa3d-46751edca9a95baff81771aa69986fa6e2422ed6.tar.gz
external_mesa3d-46751edca9a95baff81771aa69986fa6e2422ed6.tar.bz2
mesa: new _mesa_num_tex_faces() helper
Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
Diffstat (limited to 'src/mesa/main/texobj.h')
-rw-r--r--src/mesa/main/texobj.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index 93e0d77..a6f1d3a 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -78,6 +78,17 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
}
+/**
+ * Return number of faces for a texture target. This will be 6 for
+ * cube maps (and cube map arrays) and 1 otherwise.
+ */
+static inline GLuint
+_mesa_num_tex_faces(GLenum target)
+{
+ return target == GL_TEXTURE_CUBE_MAP ? 6 : 1;
+}
+
+
/** Is the texture "complete" with respect to the given sampler state? */
static inline GLboolean
_mesa_is_texture_complete(const struct gl_texture_object *texObj,