radeon: use mesa provided _mesa_tex_target_to_face function

This commit is contained in:
Maciej Cencora 2010-01-10 14:17:20 +01:00
parent 9363a813f1
commit 11affafc75
2 changed files with 3 additions and 19 deletions

View 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;

View 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,