Shader: Add module resolver + use modules for engine shaders

This commit is contained in:
Jérôme Leclercq
2022-03-10 21:00:10 +01:00
parent 98bd04e35a
commit db0c1e6e8c
30 changed files with 737 additions and 106 deletions

View File

@@ -4,8 +4,8 @@
#pragma once
#ifndef NAZARA_SHADER_AST_INDEXREMAPPER_HPP
#define NAZARA_SHADER_AST_INDEXREMAPPER_HPP
#ifndef NAZARA_SHADER_AST_INDEXREMAPPERVISITOR_HPP
#define NAZARA_SHADER_AST_INDEXREMAPPERVISITOR_HPP
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Shader/Config.hpp>
@@ -60,4 +60,4 @@ namespace Nz::ShaderAst
#include <Nazara/Shader/Ast/IndexRemapperVisitor.inl>
#endif // NAZARA_SHADER_AST_INDEXREMAPPER_HPP
#endif // NAZARA_SHADER_AST_INDEXREMAPPERVISITOR_HPP

View File

@@ -10,6 +10,7 @@
#include <Nazara/Prerequisites.hpp>
#include <Nazara/Core/Bitset.hpp>
#include <Nazara/Shader/Config.hpp>
#include <Nazara/Shader/ShaderModuleResolver.hpp>
#include <Nazara/Shader/Ast/AstCloner.hpp>
#include <Nazara/Shader/Ast/AstTypes.hpp>
#include <Nazara/Shader/Ast/Module.hpp>
@@ -42,7 +43,7 @@ namespace Nz::ShaderAst
struct Options
{
std::function<ModulePtr(const std::vector<std::string>& /*modulePath*/)> moduleCallback;
std::shared_ptr<ShaderModuleResolver> moduleResolver;
std::unordered_set<std::string> reservedIdentifiers;
std::unordered_map<UInt32, ConstantValue> optionValues;
bool makeVariableNameUnique = false;