radeon: use mesa provided _mesa_tex_target_to_face function
authorMaciej Cencora <m.cencora@gmail.com>
Sun, 10 Jan 2010 13:17:20 +0000 (14:17 +0100)
committerMaciej Cencora <m.cencora@gmail.com>
Tue, 19 Jan 2010 22:38:33 +0000 (23:38 +0100)
src/mesa/drivers/dri/radeon/radeon_texture.c
src/mesa/drivers/dri/radeon/radeon_texture.h

index 03178116c1ab0d6bfd23ab7308b970c5e8947fb0..20a27ad9a70e8994c1b9bdb10e0d12c123a8a5be 100644 (file)
@@ -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;
index 906daf12d0a62de963464d9307bf2dff15f9a9b1..4ec6a2945fb40ba6de91cdf5e7a8a84c8736c612 100644 (file)
@@ -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,