Refactor material system (#382)

This commit is contained in:
Jérôme Leclercq
2022-10-31 19:53:41 +01:00
committed by GitHub
parent 0a8048809c
commit dc6ce8427c
156 changed files with 3633 additions and 4569 deletions

View File

@@ -8,6 +8,8 @@
#define NAZARA_GRAPHICS_MATERIALPASSREGISTRY_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Utils/Algorithm.hpp>
#include <list>
#include <string>
#include <unordered_map>
@@ -21,7 +23,7 @@ namespace Nz
MaterialPassRegistry(MaterialPassRegistry&&) = default;
~MaterialPassRegistry() = default;
inline std::size_t GetPassIndex(const std::string& passName) const;
inline std::size_t GetPassIndex(std::string_view passName) const;
inline std::size_t RegisterPass(std::string passName);
@@ -29,7 +31,8 @@ namespace Nz
MaterialPassRegistry& operator=(MaterialPassRegistry&&) = default;
private:
std::unordered_map<std::string, std::size_t> m_passIndex;
std::list<std::string> m_passNames; //< in order to allow std::string_view as a key in C++17 (keep std::string stable as well because of SSO)
std::unordered_map<std::string_view, std::size_t> m_passIndex;
};
}