summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/radeon
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-08-21 20:22:27 -0600
committerBrian Paul <[email protected]>2012-08-24 06:18:41 -0600
commit46751edca9a95baff81771aa69986fa6e2422ed6 (patch)
treec0022e06d939d20f8e2fd48eace419fbebcc9e9b /src/mesa/drivers/dri/radeon
parent8a935d71ff4ded6f3cdd8e06dcd1a5e3de3d3cc0 (diff)
mesa: new _mesa_num_tex_faces() helper
Not a real big help now, but will be useful for the GL_ARB_texture_cube_map_array extension in the future.
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c4
-rw-r--r--src/mesa/drivers/dri/radeon/radeon_texture.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
index 0ef6457f513..8901090df8b 100644
--- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
+++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c
@@ -198,7 +198,7 @@ radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa,
mt->mesaFormat = mesaFormat;
mt->refcount = 1;
mt->target = target;
- mt->faces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ mt->faces = _mesa_num_tex_faces(target);
mt->baseLevel = baseLevel;
mt->numLevels = numLevels;
mt->width0 = width0;
@@ -569,7 +569,7 @@ int radeon_validate_texture_miptree(struct gl_context * ctx,
"%s: Using miptree %p\n", __FUNCTION__, t->mt);
}
- const unsigned faces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1;
+ const unsigned faces = _mesa_num_tex_faces(texObj->Target);
unsigned face, level;
radeon_texture_image *img;
/* Validate only the levels that will actually be used during rendering */
diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c
index 157cc096a31..11b825d9dab 100644
--- a/src/mesa/drivers/dri/radeon/radeon_texture.c
+++ b/src/mesa/drivers/dri/radeon/radeon_texture.c
@@ -750,7 +750,7 @@ radeon_swrast_map_texture_images(struct gl_context *ctx,
struct gl_texture_object *texObj)
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint nr_faces = _mesa_num_tex_faces(texObj->Target);
int i, face;
for (i = texObj->BaseLevel; i <= texObj->_MaxLevel; i++) {
@@ -766,7 +766,7 @@ radeon_swrast_unmap_texture_images(struct gl_context *ctx,
struct gl_texture_object *texObj)
{
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
- GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ GLuint nr_faces = _mesa_num_tex_faces(texObj->Target);
int i, face;
for (i = texObj->BaseLevel; i <= texObj->_MaxLevel; i++) {