[Mesa-dev] [PATCH 5/6] st/mesa: fix computation of last_level during texture creation
Marek Olšák
maraeo at gmail.com
Sun Nov 11 08:40:01 PST 2012
Array textures were broken.
NOTE: This is a candidate for the stable branches.
---
src/mesa/state_tracker/st_cb_texture.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 9619dd2..f06814f 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -384,10 +384,8 @@ guess_and_alloc_texture(struct st_context *st,
}
else {
/* alloc space for a full mipmap */
- GLuint l2width = util_logbase2(width);
- GLuint l2height = util_logbase2(height);
- GLuint l2depth = util_logbase2(depth);
- lastLevel = MAX2(MAX2(l2width, l2height), l2depth);
+ lastLevel = _mesa_get_tex_max_num_levels(stObj->base.Target,
+ width, height, depth) - 1;
}
/* Save the level=0 dimensions */
--
1.7.9.5
More information about the mesa-dev
mailing list