Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
PipelineSetConditioner.hpp
1#pragma once
2
3#include <filesystem>
4#include <vector>
5#include <set>
6#include <map>
7
8#include <PipelineSet/Converter/CompilationOptions.hpp>
9#include <PipelineSet/WriteCallback.hpp>
10#include <PipelineSet/Log.hpp>
11
12class PipelineSetConditioner {
13public:
14 PipelineSetConditioner(WriteCallback writeFn = nullptr, LogCallback logFn = nullptr, ResolvePathCallback resolvePathFn = nullptr);
15 void Add(const std::filesystem::path& path);
16 void Scan(const std::filesystem::path& path);
17 void Convert(CompilationOptions options);
18 void Rerun(const std::filesystem::path& path);
19 LogCallback GetLogCallback() const;
20
21private:
22 std::set<std::filesystem::path> unprocessedFiles;
23
24 struct ShaderBlock {
25 std::filesystem::path srcPath;
26 std::string code;
27 };
28
29 std::map<std::string, ShaderBlock> shaderBlocks;
30
31 struct PipelineTemplate {
32 std::filesystem::path srcPath;
33 std::vector<std::filesystem::path> requiredBlocks;
34 };
35
36 std::map<std::string, PipelineTemplate> pipelineTemplates;
37
38 ResolvePathCallback resolvePathCallback = nullptr;
39 WriteCallback writeFileCallback = nullptr;
40 LogCallback logCallback = nullptr;
41};
Definition CompilationOptions.hpp:3