Mesa (master): radeon: use mesa provided _mesa_tex_target_to_face function

Maciej Cencora osiris at kemper.freedesktop.org
Tue Jan 19 15:40:57 PST 2010


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

Author: Maciej Cencora <m.cencora at gmail.com>
Date:   Sun Jan 10 14:17:20 2010 +0100

radeon: use mesa provided _mesa_tex_target_to_face function

---

 src/mesa/drivers/dri/radeon/radeon_texture.c |   21 +++------------------
 src/mesa/drivers/dri/radeon/radeon_texture.h |    1 -
 2 files changed, 3 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 0317811..20a27ad 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -197,21 +197,6 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
 	radeon_bo_unmap(t->mt->bo);
 }
 
-GLuint radeon_face_for_target(GLenum target)
-{
-	switch (target) {
-	case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
-	case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
-	case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
-	case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
-	case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
-	case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
-		return (GLuint) target - (GLuint) GL_TEXTURE_CUBE_MAP_POSITIVE_X;
-	default:
-		return 0;
-	}
-}
-
 /**
  * Wraps Mesa's implementation to ensure that the base level image is mapped.
  *
@@ -248,7 +233,7 @@ static void radeon_generate_mipmap(GLcontext *ctx, GLenum target,
 
 void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj)
 {
-	GLuint face = radeon_face_for_target(target);
+	GLuint face = _mesa_tex_target_to_face(target);
 	radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
 
 	radeon_teximage_map(baseimage, GL_FALSE);
@@ -710,7 +695,7 @@ static void radeon_teximage(
 	radeon_texture_image* image = get_radeon_texture_image(texImage);
 	GLint postConvWidth = width;
 	GLint postConvHeight = height;
-	GLuint face = radeon_face_for_target(target);
+	GLuint face = _mesa_tex_target_to_face(target);
 
 	{
 		struct radeon_bo *bo;
@@ -863,7 +848,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve
 
 	if (RADEON_DEBUG & RADEON_TEXTURE) {
 		fprintf(stderr, "radeon_texsubimage%dd: texObj %p, texImage %p, face %d, level %d\n",
-				dims, texObj, texImage, radeon_face_for_target(target), level);
+				dims, texObj, texImage, _mesa_tex_target_to_face(target), level);
 	}
 
 	t->validated = GL_FALSE;
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h
index 906daf1..4ec6a29 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.h
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.h
@@ -44,7 +44,6 @@ void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
 void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
 void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj);
 int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj);
-GLuint radeon_face_for_target(GLenum target);
 
 gl_format radeonChooseTextureFormat_mesa(GLcontext * ctx,
                                          GLint internalFormat,



More information about the mesa-commit mailing list