From b94d32e267c8a05c58d0945f8387c3c727e7be78 Mon Sep 17 00:00:00 2001 From: Lucas Alber Date: Tue, 6 Aug 2024 20:47:38 +0200 Subject: [PATCH] fix build? --- src/merian/vk/shader/shader_hotreloader.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/merian/vk/shader/shader_hotreloader.cpp b/src/merian/vk/shader/shader_hotreloader.cpp index 4ffb769..783a158 100644 --- a/src/merian/vk/shader/shader_hotreloader.cpp +++ b/src/merian/vk/shader/shader_hotreloader.cpp @@ -18,8 +18,11 @@ HotReloader::get_shader(const std::filesystem::path& path, std::filesystem::last_write_time(*canonical); if (!shaders.contains(*canonical) || - (std::chrono::clock_cast(std::chrono::system_clock::now() - 200ms) > - last_write_time && + // workaround for this not working in older Ubuntu versions + // (std::chrono::system_clock::now().time_since_epoch() - 200ms > + // last_write_time.time_since_epoch() + ((std::chrono::system_clock::now().time_since_epoch() - 200ms) > + last_write_time.time_since_epoch() && last_write_time > shaders[*canonical].last_write_time)) { // wait additional 200ms, else the write to the file might still be in process.