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.
*
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);
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;
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;
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,