Révision | b583fdfc64b8f634156d1aba5dfc17d33f9873f1 (tree) |
---|---|
l'heure | 2013-12-11 01:15:04 |
Auteur | Osamu Takasugi <otakasugi@cres...> |
Commiter | Osamu Takasugi |
Fix wrong texture will be created when RequestedNumMipMap is 0.
@@ -136,15 +136,15 @@ | ||
136 | 136 | mMipmapsHardwareGenerated = false; |
137 | 137 | |
138 | 138 | // glGenerateMipmap require all mip levels to be prepared. So override how many this texture has. |
139 | - if(mMipmapsHardwareGenerated && (maxMips > mNumMipmaps)) | |
140 | - mNumMipmaps = maxMips; | |
139 | + if((mUsage & TU_AUTOMIPMAP) && mMipmapsHardwareGenerated && mNumRequestedMipmaps) | |
140 | + mNumMipmaps = maxMips; | |
141 | 141 | |
142 | - if(getGLES2SupportRef()->checkExtension("GL_APPLE_texture_max_level") || gleswIsSupported(3, 0)) | |
143 | - mGLSupport.getStateCacheManager()->setTexParameteri(texTarget, GL_TEXTURE_MAX_LEVEL_APPLE, mNumMipmaps + 1); | |
142 | + if((getGLES2SupportRef()->checkExtension("GL_APPLE_texture_max_level") || gleswIsSupported(3, 0))) | |
143 | + mGLSupport.getStateCacheManager()->setTexParameteri(texTarget, GL_TEXTURE_MAX_LEVEL_APPLE, mNumRequestedMipmaps ? mNumMipmaps + 1 : 0); | |
144 | 144 | |
145 | 145 | // Set some misc default parameters, these can of course be changed later |
146 | 146 | mGLSupport.getStateCacheManager()->setTexParameteri(texTarget, |
147 | - GL_TEXTURE_MIN_FILTER, (mUsage & TU_AUTOMIPMAP) ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST); | |
147 | + GL_TEXTURE_MIN_FILTER, ((mUsage & TU_AUTOMIPMAP) && mNumRequestedMipmaps) ? GL_NEAREST_MIPMAP_NEAREST : GL_NEAREST); | |
148 | 148 | mGLSupport.getStateCacheManager()->setTexParameteri(texTarget, |
149 | 149 | GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
150 | 150 | mGLSupport.getStateCacheManager()->setTexParameteri(texTarget, |