[Tizen] Ignore mipmap when texture format compressed 57/298357/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Thu, 17 Aug 2023 04:08:18 +0000 (13:08 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Wed, 6 Sep 2023 07:00:28 +0000 (16:00 +0900)
Since some graphic driver doesn't support mipmap generation automatically,
We need to ignore that mipmap using with compressed format.

Change-Id: If39facde441ed63dc26462079575dea8b1df18a3
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/graphics/gles-impl/gles-graphics-texture.cpp

index f7a2aef..e8c377c 100644 (file)
@@ -342,6 +342,12 @@ void Texture::Bind(const TextureBinding& binding) const
 
     auto mipMapMode = samplerCreateInfo.mipMapMode;
 
+    // @todo : Should we always ignore mipmap mode when it is compressed, and never bind higher level mipmap?
+    if(mMaxMipMapLevel == 0u && mIsCompressed)
+    {
+      mipMapMode = Graphics::SamplerMipmapMode::NONE;
+    }
+
     SetSamplerParameter(GL_TEXTURE_MIN_FILTER, mDefaultSamplerState.minFilter, GLSamplerFilterAndMipMapMode(samplerCreateInfo.minFilter, mipMapMode).glFilter);
     SetSamplerParameter(GL_TEXTURE_MAG_FILTER, mDefaultSamplerState.magFilter, GLSamplerFilter(samplerCreateInfo.magFilter).glFilter);
     SetSamplerParameter(GL_TEXTURE_WRAP_S, mDefaultSamplerState.wrapS, GLAddressMode(samplerCreateInfo.addressModeU).texParameter);