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.
This commit is contained in:
Brian Paul 2009-09-28 10:03:58 -06:00
parent 8fda97afb8
commit 05bad193f5
1 changed files with 3 additions and 0 deletions

View File

@ -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);