Skip to content

Commit

Permalink
Main: Material - ensure supported techniques are refreshed on reload
Browse files Browse the repository at this point in the history
defer compilation until loading for this, as GL programs are only compiled when loaded
  • Loading branch information
paroj committed Mar 4, 2024
1 parent 36f7216 commit 934950f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions OgreMain/src/OgreMaterial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,6 @@ namespace Ogre {
//-----------------------------------------------------------------------
void Material::prepareImpl(void)
{
// compile if required
if (mCompilationRequired)
compile();
// Load all supported techniques
for (auto *t : mSupportedTechniques)
{
Expand All @@ -136,6 +133,9 @@ namespace Ogre {
t->_load();
}

// compile if required
if (mCompilationRequired)
compile();
}
//-----------------------------------------------------------------------
void Material::unloadImpl(void)
Expand All @@ -145,6 +145,8 @@ namespace Ogre {
{
t->_unload();
}

mCompilationRequired = true;
}
//-----------------------------------------------------------------------
size_t Material::calculateSize(void) const
Expand Down

0 comments on commit 934950f

Please sign in to comment.