]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.h
Remove support for array size specialization from the engine as well
[libs/gl.git] / source / core / program.h
index f41a7d6ddf99d56218d8b53b6578853c2dca8e71..dd7d4b5f029789a074815ff94d9112e27c6818a6 100644 (file)
@@ -13,8 +13,10 @@ namespace Msp {
 namespace GL {
 
 /**
-A complete shader program.  Programs can be assembled of individual Shaders or
-generated with a set of standard features.
+A shader program consisting of one or more stages.
+
+Programs are created from Modules.  Specialization values can be applied to
+customize behaviour of the module.
 */
 class Program: public ProgramBackend
 {
@@ -52,16 +54,18 @@ private:
 
 public:
        /// Constructs an empty Program with no shader stages attached.
-       Program() { }
+       Program() = default;
 
        /// Constructs a Program from a Module, with specialization constants.
        Program(const Module &, const std::map<std::string, int> & = std::map<std::string, int>());
 
        void add_stages(const Module &, const std::map<std::string, int> & = std::map<std::string, int>());
 private:
-       void collect_uniforms(const SpirVModule &, const std::map<unsigned, int> &);
-       void collect_block_uniforms(const SpirVModule::Structure &, const std::string &, unsigned, const std::map<unsigned, int> &, std::vector<std::string> &);
+       void collect_uniforms(const SpirVModule &);
+       void collect_block_uniforms(const SpirVModule::Structure &, const std::string &, unsigned, std::vector<std::string> &);
        void collect_attributes(const SpirVModule &);
+       void collect_builtins(const SpirVModule &);
+       void collect_builtins(const SpirVModule::Structure &);
 
 public:
        ReflectData::LayoutHash get_uniform_layout_hash() const { return reflect_data.layout_hash; }
@@ -76,6 +80,7 @@ public:
        const std::vector<ReflectData::AttributeInfo> &get_attributes() const { return reflect_data.attributes; }
        const ReflectData::AttributeInfo &get_attribute_info(const std::string &) const;
        int get_attribute_location(const std::string &) const;
+       unsigned get_n_clip_distances() const { return reflect_data.n_clip_distances; }
 
        using ProgramBackend::set_debug_name;
 };