Check if textureview is available before filtering

This commit is contained in:
Vincent Lejeune 2014-11-03 00:57:07 +01:00
parent e5b269949a
commit f2da00954d
3 changed files with 13 additions and 1 deletions

View File

@ -513,6 +513,7 @@ void IrrDriver::initDevice()
hasDrawIndirect = false;
hasComputeShaders = false;
hasTextureStorage = false;
hasTextureView = false;
// Default false value for hasVSLayer if --no-graphics argument is used
#if !defined(__APPLE__)
if (!ProfileWorld::isNoGraphics())
@ -541,6 +542,10 @@ void IrrDriver::initDevice()
hasTextureStorage = true;
Log::info("GLDriver", "ARB Texture Storage enabled");
}
if (hasGLExtension("GL_ARB_texture_view")) {
hasTextureView = true;
Log::info("GLDriver", "ARB Texture View enabled");
}
}
#endif

View File

@ -180,6 +180,7 @@ private:
bool hasBuffserStorage;
bool hasComputeShaders;
bool hasTextureStorage;
bool hasTextureView;
bool m_need_ubo_workaround;
bool m_need_rh_workaround;
bool m_need_srgb_workaround;
@ -311,6 +312,11 @@ public:
return hasTextureStorage;
}
bool hasARBTextureView() const
{
return hasTextureView;
}
video::SColorf getAmbientLight() const;
struct GlowData {

View File

@ -1026,7 +1026,8 @@ void IrrDriver::renderShadows()
glDisable(GL_POLYGON_OFFSET_FILL);
m_post_processing->renderGaussian6BlurLayer(m_rtts->getShadowFBO());
if (irr_driver->hasARBTextureView())
m_post_processing->renderGaussian6BlurLayer(m_rtts->getShadowFBO());
glBindTexture(GL_TEXTURE_2D_ARRAY, m_rtts->getShadowFBO().getRTT()[0]);
glGenerateMipmap(GL_TEXTURE_2D_ARRAY);
}