diff options
author | Brian Paul <[email protected]> | 2009-09-28 10:03:58 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-28 10:03:58 -0600 |
commit | 05bad193f56d48384097e37e47fae3fdda85f144 (patch) | |
tree | 47f275e19137019b2561020f57eb833074d02ec0 | |
parent | 8fda97afb8b7a03415dbca6d83691d2d6461126c (diff) |
st/mesa: check gl_texture_object::GenerateMipmap field when allocating texmem
In guess_and_alloc_texture() use the gl_texture_object::GenerateMipmap
field as another hint as to whether to allocate space for a whole mipmap.
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index c0fba8641b3..771a0e2bbdf 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -328,10 +328,13 @@ guess_and_alloc_texture(struct st_context *st, stObj->base.MinFilter == GL_LINEAR || stImage->base._BaseFormat == GL_DEPTH_COMPONENT || stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) && + !stObj->base.GenerateMipmap && stImage->level == firstLevel) { + /* only alloc space for a single mipmap level */ lastLevel = firstLevel; } else { + /* alloc space for a full mipmap */ GLuint l2width = util_logbase2(width); GLuint l2height = util_logbase2(height); GLuint l2depth = util_logbase2(depth); |