summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texstorage.c
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/main/texstorage.c
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/main/texstorage.c')
-rw-r--r--src/mesa/main/texstorage.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
index 5e1f31a9377..f8af8bf012b 100644
--- a/src/mesa/main/texstorage.c
+++ b/src/mesa/main/texstorage.c
@@ -36,6 +36,7 @@
#include "macros.h"
#include "mfeatures.h"
#include "teximage.h"
+#include "texobj.h"
#include "texstorage.h"
#include "mtypes.h"
@@ -128,7 +129,7 @@ setup_texstorage(struct gl_context *ctx,
GLsizei width, GLsizei height, GLsizei depth)
{
const GLenum target = texObj->Target;
- const GLuint numFaces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ const GLuint numFaces = _mesa_num_tex_faces(target);
gl_format texFormat;
GLint level, levelWidth = width, levelHeight = height, levelDepth = depth;
GLuint face;
@@ -206,7 +207,7 @@ clear_image_fields(struct gl_context *ctx,
struct gl_texture_object *texObj)
{
const GLenum target = texObj->Target;
- const GLuint numFaces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
+ const GLuint numFaces = _mesa_num_tex_faces(target);
GLint level;
GLuint face;