aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2009-01-21 18:41:11 +1000
committerDave Airlie <[email protected]>2009-01-21 18:41:11 +1000
commit2bf31b7ffdee0b84e916d5ee4aa487f2e61a1ff7 (patch)
treed245e1a7dd1b3e3bab4b757b86f0fed06077443e /src/mesa/drivers/dri/radeon
parente0ec3243e87cbdfb5db2657fe791748e145930e8 (diff)
r300/radeon: move face_for_target
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/common_misc.c17
-rw-r--r--src/mesa/drivers/dri/radeon/common_misc.h1
2 files changed, 16 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/radeon/common_misc.c b/src/mesa/drivers/dri/radeon/common_misc.c
index f70a694eb92..2d0fc3a0dd3 100644
--- a/src/mesa/drivers/dri/radeon/common_misc.c
+++ b/src/mesa/drivers/dri/radeon/common_misc.c
@@ -1447,7 +1447,20 @@ 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.
@@ -1457,7 +1470,7 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj)
*/
void radeon_generate_mipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj)
{
- GLuint face = face_for_target(target);
+ GLuint face = radeon_face_for_target(target);
radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[face][texObj->BaseLevel]);
radeon_teximage_map(baseimage, GL_FALSE);
diff --git a/src/mesa/drivers/dri/radeon/common_misc.h b/src/mesa/drivers/dri/radeon/common_misc.h
index a55e00a76c5..828fb85b38b 100644
--- a/src/mesa/drivers/dri/radeon/common_misc.h
+++ b/src/mesa/drivers/dri/radeon/common_misc.h
@@ -42,4 +42,5 @@ void radeon_teximage_unmap(radeon_texture_image *image);
void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
void radeon_generate_mipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj);
+GLuint radeon_face_for_target(GLenum target);
#endif