summaryrefslogtreecommitdiff
path: root/src/gpu/effects/shader_composer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/effects/shader_composer.h')
-rw-r--r--src/gpu/effects/shader_composer.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/effects/shader_composer.h b/src/gpu/effects/shader_composer.h
index 49bf00c..a63a6a4 100644
--- a/src/gpu/effects/shader_composer.h
+++ b/src/gpu/effects/shader_composer.h
@@ -4,6 +4,7 @@
#pragma once
#include <map>
+#include <set>
#include <string>
#include <vector>
@@ -15,10 +16,15 @@ class ShaderComposer {
void RegisterSnippet(const std::string& name, const std::string& code);
// Assemble a final shader string by prepending required snippets
+ // and recursively resolving #include "snippet_name" directives.
std::string Compose(const std::vector<std::string>& dependencies,
const std::string& main_code);
private:
ShaderComposer() = default;
+
+ void ResolveRecursive(const std::string& source, std::stringstream& ss,
+ std::set<std::string>& included);
+
std::map<std::string, std::string> snippets_;
};