Shader: Add module resolver + use modules for engine shaders
This commit is contained in:
36
include/Nazara/Shader/DirectoryModuleResolver.inl
Normal file
36
include/Nazara/Shader/DirectoryModuleResolver.inl
Normal file
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2022 Jérôme "Lynix" Leclercq (lynix680@gmail.com)
|
||||
// This file is part of the "Nazara Engine - Shader module"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#include <Nazara/Shader/DirectoryModuleResolver.hpp>
|
||||
#include <Nazara/Shader/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
inline DirectoryModuleResolver::DirectoryModuleResolver() :
|
||||
m_searchDirectory(std::make_shared<VirtualDirectory>())
|
||||
{
|
||||
}
|
||||
|
||||
inline void DirectoryModuleResolver::RegisterModuleDirectory(std::string_view path, std::filesystem::path realPath)
|
||||
{
|
||||
m_searchDirectory->StoreDirectory(path, realPath);
|
||||
}
|
||||
|
||||
inline void DirectoryModuleResolver::RegisterModuleFile(std::string_view path, std::filesystem::path realPath)
|
||||
{
|
||||
m_searchDirectory->StoreFile(path, realPath);
|
||||
}
|
||||
|
||||
inline void DirectoryModuleResolver::RegisterModuleFile(std::string_view path, std::vector<UInt8> fileContent)
|
||||
{
|
||||
m_searchDirectory->StoreFile(path, std::move(fileContent));
|
||||
}
|
||||
|
||||
inline void DirectoryModuleResolver::RegisterModuleFile(std::string_view path, const void* staticData, std::size_t size)
|
||||
{
|
||||
m_searchDirectory->StoreFile(path, staticData, size);
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Shader/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user