vsg: include/vsg/utils/ShaderCompiler.h Source File

vsg 1.1.9 VulkanSceneGraph library |

Loading...
Searching...
No Matches
ShaderCompiler.h
1#pragma once
2
3#include <vsg/core/Visitor.h>
4#include <vsg/io/FileSystem.h>
5#include <vsg/state/ShaderStage.h>
6
7namespace vsg
8{
9
14 class VSG_DECLSPEC ShaderCompiler : public Inherit<Visitor, ShaderCompiler>
15 {
16 public:
17 ShaderCompiler();
18 virtual ~ShaderCompiler();
19
22 bool supported() const;
23
24 // default ShaderCompileSettings
25 ref_ptr<ShaderCompileSettings> defaults;
26
27 bool compile(ShaderStages& shaders, const std::vector<std::string>& defines = {}, ref_ptr<const Options> options = {});
28 bool compile(ref_ptr<ShaderStage> shaderStage, const std::vector<std::string>& defines = {}, ref_ptr<const Options> options = {});
29
30 std::string combineSourceAndDefines(const std::string& source, const std::vector<std::string>& defines);
31
32 void apply(Node& node) override;
33 void apply(BindGraphicsPipeline& bgp) override;
34 void apply(BindComputePipeline& bgp) override;
35 void apply(BindRayTracingPipeline& bgp) override;
36
37 protected:
38 bool _initialized = false;
39 };
40 VSG_type_name(vsg::ShaderCompiler);
41
42} // namespace vsg
vsg::ShaderCompiler::supported
bool supported() const
vsg::ref_ptr
Definition ref_ptr.h:22