mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-04 22:49:13 +02:00
st/mesa: don't allocate mipmapped texture for NEAREST_MIPMAP_LINEAR
Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
5180a222c0
commit
d1ad4fda31
1 changed files with 12 additions and 0 deletions
|
|
@ -523,6 +523,18 @@ allocate_full_mipmap(const struct st_texture_object *stObj,
|
|||
/* not a mipmap minification filter */
|
||||
return FALSE;
|
||||
|
||||
/* If the following sequence of GL calls is used:
|
||||
* glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, w, h, 0, GL_RGB, ...
|
||||
* glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
*
|
||||
* we would needlessly allocate a mipmapped texture, because the initial
|
||||
* MinFilter is GL_NEAREST_MIPMAP_LINEAR. Catch this case and don't
|
||||
* allocate a mipmapped texture by default. This may cause texture
|
||||
* reallocation later, but GL_NEAREST_MIPMAP_LINEAR is pretty rare.
|
||||
*/
|
||||
if (stObj->base.Sampler.MinFilter == GL_NEAREST_MIPMAP_LINEAR)
|
||||
return FALSE;
|
||||
|
||||
if (stObj->base.Target == GL_TEXTURE_3D)
|
||||
/* 3D textures are seldom mipmapped */
|
||||
return FALSE;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue