[Mesa-dev] [PATCH 01/37] mesa: add gl_texture_image::Face, Level fields

Eric Anholt eric at anholt.net
Mon Aug 15 11:53:31 PDT 2011


From: Brian Paul <brianp at vmware.com>

Several drivers have these fields in their subclasses of gl_texture_image.
They'll be useful for core Mesa too...
---
 src/mesa/main/mtypes.h   |    2 ++
 src/mesa/main/teximage.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 2d5f44c..12120a9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -1279,6 +1279,8 @@ struct gl_texture_image
    GLboolean _IsPowerOfTwo;	/**< Are all dimensions powers of two? */
 
    struct gl_texture_object *TexObject;  /**< Pointer back to parent object */
+   GLuint Level;                /**< Which mipmap level am I? */
+   GLuint Face;                 /**< Which cube face am I? */
 
    FetchTexelFuncC FetchTexelc;	/**< GLchan texel fetch function pointer */
    FetchTexelFuncF FetchTexelf;	/**< Float texel fetch function pointer */
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index 27717cf..a005d29 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -571,6 +571,8 @@ _mesa_set_tex_image(struct gl_texture_object *tObj,
 
    /* Set the 'back' pointer */
    texImage->TexObject = tObj;
+   texImage->Level = level;
+   texImage->Face = face;
 }
 
 
-- 
1.7.5.4



More information about the mesa-dev mailing list