Add shader compiler (nzslc) and use it

This commit is contained in:
SirLynix
2022-04-06 09:04:09 +02:00
parent 262c82b9e1
commit 8784ec9b47
9 changed files with 331 additions and 21 deletions

View File

@@ -36,6 +36,7 @@ namespace Nz
FilesystemModuleResolver& operator=(const FilesystemModuleResolver&) = delete;
FilesystemModuleResolver& operator=(FilesystemModuleResolver&&) noexcept = delete;
static constexpr const char* CompiledModuleExtension = ".nzslb";
static constexpr const char* ModuleExtension = ".nzsl";
private:
@@ -44,6 +45,8 @@ namespace Nz
void OnFileMoved(std::string_view directory, std::string_view filename, std::string_view oldFilename);
void OnFileUpdated(std::string_view directory, std::string_view filename);
static bool CheckExtension(std::string_view filename);
std::unordered_map<std::string, std::string> m_moduleByFilepath;
std::unordered_map<std::string, ShaderAst::ModulePtr> m_modules;
MovablePtr<void> m_fileWatcher;