Hot reload done only once every 200 ms, no point in beeing faster

it may also help with bugs where the file is still locked and can't be opened
This commit is contained in:
florent.teppe
2022-08-04 13:37:12 +02:00
parent 15751c57a0
commit 3ab0a99154
+2 -1
View File
@@ -387,7 +387,8 @@ namespace Shader
void update(ShaderManager& Manager)
{
if (mHotReloadEnabled)
auto timeSinceLastCheckMillis = std::chrono::duration_cast<std::chrono::milliseconds>(std::filesystem::file_time_type::clock::now() - mLastAutoRecompileTime);
if (mHotReloadEnabled && timeSinceLastCheckMillis.count() > 200)
reloadTouchedShaders(Manager);
}