Mesa (master): i965: Delete the fabulous target_to_target() function.

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Feb 22 03:15:52 UTC 2014


Module: Mesa
Branch: master
Commit: 119aa50929d418a9f410d562b26aec8e1b2a482d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=119aa50929d418a9f410d562b26aec8e1b2a482d

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Feb 21 13:47:29 2014 -0800

i965: Delete the fabulous target_to_target() function.

gl_texture_object's Target field is never a cube face enumeration, so
target_to_target is just the identity function.  Aptly named, at least.

I verified this by putting an assert(!"ZOMG, CUBES!") in the cube face
case, and running Piglit.  Nothing ever hit it.  Beyond that, I
inspected the code in mesa/main.

This could probably also be deleted from i915, but I haven't tested
there.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/intel_mipmap_tree.c |   21 ++-------------------
 1 file changed, 2 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index fb99edc..97816d4 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -49,23 +49,6 @@
 
 #define FILE_DEBUG_FLAG DEBUG_MIPTREE
 
-static GLenum
-target_to_target(GLenum target)
-{
-   switch (target) {
-   case GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB:
-   case GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB:
-   case GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB:
-   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB:
-   case GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB:
-   case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB:
-      return GL_TEXTURE_CUBE_MAP_ARB;
-   default:
-      return target;
-   }
-}
-
-
 /**
  * Determine which MSAA layout should be used by the MSAA surface being
  * created, based on the chip generation and the surface type.
@@ -252,7 +235,7 @@ intel_miptree_create_layout(struct brw_context *brw,
        _mesa_get_format_name(format),
        first_level, last_level, mt);
 
-   mt->target = target_to_target(target);
+   mt->target = target;
    mt->format = format;
    mt->first_level = first_level;
    mt->last_level = last_level;
@@ -858,7 +841,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt,
     * objects can't change targets over their lifetimes, so this should be
     * true.
     */
-   assert(target_to_target(image->TexObject->Target) == mt->target);
+   assert(image->TexObject->Target == mt->target);
 
    mesa_format mt_format = mt->format;
    if (mt->format == MESA_FORMAT_Z24_UNORM_X8_UINT && mt->stencil_mt)




More information about the mesa-commit mailing list