]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.h
Set OpenGL debug labels on various objects loaded from Resources
[libs/gl.git] / source / core / program.h
index 6ed2f5716e7e50e0e20371204bb1eb32035a2aa5..a2324f2329cc0fbaa3c8a4a2ea733384d02e6aeb 100644 (file)
@@ -101,14 +101,23 @@ public:
        };
 
 private:
+       enum Stage
+       {
+               VERTEX,
+               GEOMETRY,
+               FRAGMENT,
+               MAX_STAGES
+       };
+
        struct TransientData
        {
                std::map<std::string, unsigned> textures;
                std::map<std::string, unsigned> blocks;
+               std::map<unsigned, int> spec_values;
        };
 
        unsigned id;
-       std::vector<unsigned> stage_ids;
+       unsigned stage_ids[MAX_STAGES];
        const Module *module;
        TransientData *transient;
        bool linked;
@@ -116,6 +125,7 @@ private:
        std::vector<UniformInfo> uniforms;
        LayoutHash uniform_layout_hash;
        std::vector<AttributeInfo> attributes;
+       std::string debug_name;
 
 public:
        /// Constructs an empty Program with no shader stages attached.
@@ -137,7 +147,8 @@ public:
 
        void add_stages(const Module &, const std::map<std::string, int> & = std::map<std::string, int>());
 private:
-       unsigned add_stage(GLenum);
+       bool has_stages() const;
+       unsigned add_stage(Stage);
        void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
        void compile_glsl_stage(unsigned);
        void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
@@ -182,6 +193,10 @@ public:
 
        void bind() const;
        static void unbind();
+
+       void set_debug_name(const std::string &);
+private:
+       void set_stage_debug_name(unsigned, Stage);
 };
 
 } // namespace GL