// Copyright (C) 2017 Jérôme Leclercq // This file is part of the "Nazara Engine - Graphics module" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_UBER_SHADER_HPP #define NAZARA_UBER_SHADER_HPP #include #include #include #include #include namespace Nz { class ShaderModule; class NAZARA_GRAPHICS_API UberShader { public: UberShader(ShaderStageTypeFlags shaderStages, const ShaderAst::StatementPtr& shaderAst); ~UberShader() = default; UInt64 GetOptionFlagByName(const std::string& optionName) const; inline ShaderStageTypeFlags GetSupportedStages() const; const std::shared_ptr& Get(UInt64 combination); private: std::unordered_map> m_combinations; std::unordered_map m_optionIndexByName; ShaderAst::StatementPtr m_shaderAst; ShaderStageTypeFlags m_shaderStages; UInt64 m_combinationMask; }; } #include #endif // NAZARA_UBER_SHADER_HPP