From 913bbe347b0b0704800d61b3470d11fc69e36ab7 Mon Sep 17 00:00:00 2001 From: scrawl Date: Mon, 2 Nov 2015 00:52:20 +0100 Subject: [PATCH] Don't check the extension string every frame --- apps/openmw/mwrender/water.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwrender/water.cpp b/apps/openmw/mwrender/water.cpp index c44f480f8..c6061b40a 100644 --- a/apps/openmw/mwrender/water.cpp +++ b/apps/openmw/mwrender/water.cpp @@ -426,8 +426,12 @@ class DepthClampCallback : public osg::Drawable::DrawCallback public: virtual void drawImplementation(osg::RenderInfo& renderInfo,const osg::Drawable* drawable) const { - if (!osg::isGLExtensionOrVersionSupported(renderInfo.getState()->getContextID(), "GL_ARB_depth_clamp", 3.3)) + static bool supported = osg::isGLExtensionOrVersionSupported(renderInfo.getState()->getContextID(), "GL_ARB_depth_clamp", 3.3); + if (!supported) + { drawable->drawImplementation(renderInfo); + return; + } glEnable(GL_DEPTH_CLAMP);