Skip to content

Commit

Permalink
fix build?
Browse files Browse the repository at this point in the history
  • Loading branch information
LDAP committed Aug 6, 2024
1 parent 61ca1fb commit b94d32e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/merian/vk/shader/shader_hotreloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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::file_clock>(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.

Expand Down

0 comments on commit b94d32e

Please sign in to comment.