vsg  1.1.0
VulkanSceneGraph library
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 
7 namespace vsg
8 {
9 
14  class VSG_DECLSPEC ShaderCompiler : public Inherit<Visitor, ShaderCompiler>
15  {
16  public:
18  virtual ~ShaderCompiler();
19 
22  bool supported() const;
23 
24  // default ShaderCompileSettings
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(StateGroup& stategroup) override;
34  void apply(BindGraphicsPipeline& bgp) override;
35  void apply(BindComputePipeline& bgp) override;
36  void apply(BindRayTracingPipeline& bgp) override;
37 
38  protected:
39  bool _initialized = false;
40  };
41  VSG_type_name(vsg::ShaderCompiler);
42 
43 } // namespace vsg
Definition: Inherit.h:28
Definition: ShaderCompiler.h:15
bool supported() const
Definition: ref_ptr.h:22