diff options
author | Brian Paul <[email protected]> | 2012-08-21 20:22:27 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2012-08-24 06:18:41 -0600 |
commit | 46751edca9a95baff81771aa69986fa6e2422ed6 (patch) | |
tree | c0022e06d939d20f8e2fd48eace419fbebcc9e9b /src/mesa/drivers/dri/intel | |
parent | 8a935d71ff4ded6f3cdd8e06dcd1a5e3de3d3cc0 (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/intel')
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex.c | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_tex_validate.c | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 4abe9885369..5d938798d9f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -120,7 +120,7 @@ intel_alloc_texture_storage(struct gl_context *ctx, GLsizei levels, GLsizei width, GLsizei height, GLsizei depth) { - const int numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + const int numFaces = _mesa_num_tex_faces(texObj->Target); int face; int level; diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 34bbbb83930..77c93290216 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -1,6 +1,7 @@ #include "main/mtypes.h" #include "main/macros.h" #include "main/samplerobj.h" +#include "main/texobj.h" #include "intel_context.h" #include "intel_mipmap_tree.h" @@ -95,7 +96,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* Pull in any images not in the object's tree: */ - nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + nr_faces = _mesa_num_tex_faces(intelObj->base.Target); for (face = 0; face < nr_faces; face++) { for (i = tObj->BaseLevel; i <= intelObj->_MaxLevel; i++) { struct intel_texture_image *intelImage = @@ -181,7 +182,7 @@ intel_tex_map_images(struct intel_context *intel, struct intel_texture_object *intelObj, GLbitfield mode) { - GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target); int i, face; DBG("%s\n", __FUNCTION__); @@ -200,7 +201,7 @@ void intel_tex_unmap_images(struct intel_context *intel, struct intel_texture_object *intelObj) { - GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint nr_faces = _mesa_num_tex_faces(intelObj->base.Target); int i, face; for (i = intelObj->base.BaseLevel; i <= intelObj->_MaxLevel; i++) { |