[Mesa-dev] [PATCH 07/11] intel: Use the gl_format to get the base_format for miptree create.

Eric Anholt eric at anholt.net
Fri Jun 10 13:38:19 PDT 2011


One less argument to this insanely long function call.
---
 src/mesa/drivers/dri/intel/intel_fbo.c          |    1 -
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c  |    2 +-
 src/mesa/drivers/dri/intel/intel_mipmap_tree.h  |    1 -
 src/mesa/drivers/dri/intel/intel_tex_image.c    |    1 -
 src/mesa/drivers/dri/intel/intel_tex_validate.c |    1 -
 5 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c
index ac63557..3b36b99 100644
--- a/src/mesa/drivers/dri/intel/intel_fbo.c
+++ b/src/mesa/drivers/dri/intel/intel_fbo.c
@@ -642,7 +642,6 @@ intel_render_texture(struct gl_context * ctx,
 
       new_mt = intel_miptree_create(intel, image->TexObject->Target,
 				    intel_image->base.TexFormat,
-				    intel_image->base._BaseFormat,
 				    intel_image->level,
 				    intel_image->level,
 				    intel_image->base.Width,
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 689755a..1b088ee 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -105,7 +105,6 @@ struct intel_mipmap_tree *
 intel_miptree_create(struct intel_context *intel,
 		     GLenum target,
 		     gl_format format,
-		     GLenum base_format,
 		     GLuint first_level,
 		     GLuint last_level,
 		     GLuint width0,
@@ -115,6 +114,7 @@ intel_miptree_create(struct intel_context *intel,
 {
    struct intel_mipmap_tree *mt;
    uint32_t tiling = I915_TILING_NONE;
+   GLenum base_format = _mesa_get_format_base_format(format);
 
    if (intel->use_texture_tiling && compress_byte == 0) {
       if (intel->gen >= 4 &&
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
index c1eb200..c259e51 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h
@@ -137,7 +137,6 @@ struct intel_mipmap_tree
 struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel,
                                                GLenum target,
 					       gl_format format,
-                                               GLenum base_format,
                                                GLuint first_level,
                                                GLuint last_level,
                                                GLuint width0,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c
index 1a3665c..b7d0eb1 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_image.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_image.c
@@ -116,7 +116,6 @@ intel_miptree_create_for_teximage(struct intel_context *intel,
    return intel_miptree_create(intel,
 			       intelObj->base.Target,
 			       intelImage->base.TexFormat,
-			       intelImage->base._BaseFormat,
 			       firstLevel,
 			       lastLevel,
 			       width,
diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c
index a6de0de..e810db8 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_validate.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c
@@ -134,7 +134,6 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit)
       intelObj->mt = intel_miptree_create(intel,
                                           intelObj->base.Target,
 					  firstImage->base.TexFormat,
-                                          firstImage->base._BaseFormat,
                                           tObj->BaseLevel,
                                           intelObj->_MaxLevel,
                                           firstImage->base.Width,
-- 
1.7.5.3



More information about the mesa-dev mailing list