diff options
author | Courtney Goeltzenleuchter <[email protected]> | 2013-11-25 16:31:26 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2013-12-13 12:31:54 -0700 |
commit | bb5947de995d6425a681e591ed9566688772a3ca (patch) | |
tree | 0de72c8372d82c6f1f868ef9ab35e6b63790f943 /src/mesa/main/texstorage.c | |
parent | 320ec1deacd97fd32f14331030660f8fceb7235c (diff) |
mesa: consolidate multiple next_mipmap_level_size
Refactor to make next_mipmap_level_size defined in mipmap.c a
_mesa_ helper function that can then be used by texture_view
Signed-off-by: Courtney Goeltzenleuchter <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/texstorage.c')
-rw-r--r-- | src/mesa/main/texstorage.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 83561c194de..1dd63a31737 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -37,6 +37,7 @@ #include "macros.h" #include "teximage.h" #include "texobj.h" +#include "mipmap.h" #include "texstorage.h" #include "mtypes.h" @@ -98,27 +99,6 @@ legal_texobj_target(struct gl_context *ctx, GLuint dims, GLenum target) } -/** - * Compute the size of the next mipmap level. - */ -static void -next_mipmap_level_size(GLenum target, - GLint *width, GLint *height, GLint *depth) -{ - if (*width > 1) { - *width /= 2; - } - - if ((*height > 1) && (target != GL_TEXTURE_1D_ARRAY)) { - *height /= 2; - } - - if ((*depth > 1) && (target != GL_TEXTURE_2D_ARRAY)) { - *depth /= 2; - } -} - - /** Helper to get a particular texture image in a texture object */ static struct gl_texture_image * get_tex_image(struct gl_context *ctx, @@ -162,7 +142,8 @@ initialize_texture_fields(struct gl_context *ctx, 0, internalFormat, texFormat); } - next_mipmap_level_size(target, &levelWidth, &levelHeight, &levelDepth); + _mesa_next_mipmap_level_size(target, 0, levelWidth, levelHeight, levelDepth, + &levelWidth, &levelHeight, &levelDepth); } return GL_TRUE; } |