Shader/FilesystemModuleResolver: Fix RegisterModuleDirectory
This commit is contained in:
parent
0e92ef823d
commit
06406fc20e
|
|
@ -24,10 +24,10 @@ namespace Nz
|
||||||
FilesystemModuleResolver(FilesystemModuleResolver&&) = default;
|
FilesystemModuleResolver(FilesystemModuleResolver&&) = default;
|
||||||
~FilesystemModuleResolver() = default;
|
~FilesystemModuleResolver() = default;
|
||||||
|
|
||||||
void RegisterModule(std::filesystem::path realPath);
|
void RegisterModule(const std::filesystem::path& realPath);
|
||||||
void RegisterModule(std::string_view moduleSource);
|
void RegisterModule(std::string_view moduleSource);
|
||||||
void RegisterModule(ShaderAst::ModulePtr module);
|
void RegisterModule(ShaderAst::ModulePtr module);
|
||||||
void RegisterModuleDirectory(std::filesystem::path realPath);
|
void RegisterModuleDirectory(const std::filesystem::path& realPath);
|
||||||
|
|
||||||
ShaderAst::ModulePtr Resolve(const std::string& moduleName) override;
|
ShaderAst::ModulePtr Resolve(const std::string& moduleName) override;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
namespace Nz
|
namespace Nz
|
||||||
{
|
{
|
||||||
void FilesystemModuleResolver::RegisterModule(std::filesystem::path realPath)
|
void FilesystemModuleResolver::RegisterModule(const std::filesystem::path& realPath)
|
||||||
{
|
{
|
||||||
return RegisterModule(ShaderLang::ParseFromFile(realPath));
|
return RegisterModule(ShaderLang::ParseFromFile(realPath));
|
||||||
}
|
}
|
||||||
|
|
@ -32,11 +32,11 @@ namespace Nz
|
||||||
m_modules.emplace(std::move(moduleName), std::move(module));
|
m_modules.emplace(std::move(moduleName), std::move(module));
|
||||||
}
|
}
|
||||||
|
|
||||||
void FilesystemModuleResolver::RegisterModuleDirectory(std::filesystem::path realPath)
|
void FilesystemModuleResolver::RegisterModuleDirectory(const std::filesystem::path& realPath)
|
||||||
{
|
{
|
||||||
for (const auto& entry : std::filesystem::recursive_directory_iterator(realPath))
|
for (const auto& entry : std::filesystem::recursive_directory_iterator(realPath))
|
||||||
{
|
{
|
||||||
if (entry.is_regular_file() && StringEqual(entry.path().extension().generic_u8string(), "nzsl", Nz::CaseIndependent{}))
|
if (entry.is_regular_file() && StringEqual(entry.path().extension().generic_u8string(), ".nzsl", Nz::CaseIndependent{}))
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue