Shader: StatementPtr& => const StatementPtr&

This commit is contained in:
Jérôme Leclercq
2021-04-17 18:10:48 +02:00
parent 1a8599ba29
commit 500ccda85a
12 changed files with 26 additions and 22 deletions

View File

@@ -20,15 +20,16 @@ namespace Nz
class NAZARA_GRAPHICS_API UberShader
{
public:
UberShader(ShaderStageType shaderStage, ShaderAst::StatementPtr shaderAst);
UberShader(ShaderStageType shaderStage, const ShaderAst::StatementPtr& shaderAst);
~UberShader() = default;
UInt64 GetConditionFlagByName(const std::string_view& condition) const;
UInt64 GetOptionFlagByName(const std::string& optionName) const;
const std::shared_ptr<ShaderModule>& Get(UInt64 combination);
private:
std::unordered_map<UInt64 /*combination*/, std::shared_ptr<ShaderModule>> m_combinations;
std::unordered_map<std::string, std::size_t> m_optionIndexByName;
ShaderAst::StatementPtr m_shaderAst;
ShaderStageType m_shaderStage;
UInt64 m_combinationMask;