diff --git a/components/fx/stateupdater.cpp b/components/fx/stateupdater.cpp index 42f290eadf..9e86f25b9c 100644 --- a/components/fx/stateupdater.cpp +++ b/components/fx/stateupdater.cpp @@ -7,6 +7,8 @@ namespace fx { + std::string StateUpdater::sDefinition = UniformData::getDefinition("_omw_data"); + StateUpdater::StateUpdater(bool useUBO) : mUseUBO(useUBO) { diff --git a/components/fx/stateupdater.hpp b/components/fx/stateupdater.hpp index c4bf71642c..f1a4cd89f3 100644 --- a/components/fx/stateupdater.hpp +++ b/components/fx/stateupdater.hpp @@ -100,11 +100,7 @@ namespace fx mPointLightBuffer = std::move(buffer); } - static std::string getStructDefinition() - { - static std::string definition = UniformData::getDefinition("_omw_data"); - return definition; - } + static const std::string& getStructDefinition() { return sDefinition; } void setDefaults(osg::StateSet* stateset) override; @@ -275,6 +271,8 @@ namespace fx UniformData mData; bool mUseUBO; + static std::string sDefinition; + std::shared_ptr mPointLightBuffer; }; }