mesa: add _mesa_base_tex_image() helper function
authorBrian Paul <brianp@vmware.com>
Fri, 2 Jan 2015 23:56:12 +0000 (16:56 -0700)
committerBrian Paul <brianp@vmware.com>
Mon, 5 Jan 2015 20:50:54 +0000 (13:50 -0700)
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/teximage.h

index 4b27381a0b9990dce2ed2a323f9113e6528f27d2..caca9710f9ad8ce183443b831581473c8bff7c04 100644 (file)
@@ -114,6 +114,16 @@ _mesa_get_tex_image(struct gl_context *ctx, struct gl_texture_object *texObj,
                     GLenum target, GLint level);
 
 
+/**
+ * Return the base-level texture image for the given texture object.
+ */
+static inline const struct gl_texture_image *
+_mesa_base_tex_image(const struct gl_texture_object *texObj)
+{
+   return texObj->Image[0][texObj->BaseLevel];
+}
+
+
 extern GLint
 _mesa_max_texture_levels(struct gl_context *ctx, GLenum target);