Browse Source

st/mesa: improve the guess_and_alloc_texture() heuristic

If GL_BASE_LEVEL==0 and GL_MAX_LEVEL==0 that's a pretty good hint that
there'll be a single mipmap level in the texture.

Google Earth sets the texture's state this way before the first glTexImage
call.  This saves a bit of texture memory.
tags/gles3-fmt-v1
Brian Paul 13 years ago
parent
commit
6551c4ea3c
1 changed files with 2 additions and 0 deletions
  1. 2
    0
      src/mesa/state_tracker/st_cb_texture.c

+ 2
- 0
src/mesa/state_tracker/st_cb_texture.c View File

@@ -375,6 +375,8 @@ guess_and_alloc_texture(struct st_context *st,
*/
if ((stObj->base.Sampler.MinFilter == GL_NEAREST ||
stObj->base.Sampler.MinFilter == GL_LINEAR ||
(stObj->base.BaseLevel == 0 &&
stObj->base.MaxLevel == 0) ||
stImage->base._BaseFormat == GL_DEPTH_COMPONENT ||
stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) &&
!stObj->base.GenerateMipmap &&

Loading…
Cancel
Save