Add support for shader hotreloading

This commit is contained in:
Jérôme Leclercq
2022-03-17 21:36:36 +01:00
parent 667a4a0c08
commit 615509d1ba
16 changed files with 285 additions and 40 deletions

View File

@@ -1432,11 +1432,13 @@ namespace Nz::ShaderLang
}
std::size_t length = static_cast<std::size_t>(file.GetSize());
if (length == 0)
return {};
std::vector<Nz::UInt8> source(length);
if (file.Read(&source[0], length) != length)
{
NazaraError("Failed to read program file");
NazaraError("Failed to read shader file");
return {};
}