Refactor material system (#382)
This commit is contained in:
@@ -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;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user