]> git.tdb.fi Git - libs/gl.git/blobdiff - source/backends/opengl/program_backend.h
Support compute shaders and compute operations
[libs/gl.git] / source / backends / opengl / program_backend.h
index 2a223ff5ae1b50ffc46fc343c4a45996a04208cc..1a548ed69116d66d96bdd28e5194abb1cd441dfd 100644 (file)
@@ -20,15 +20,10 @@ protected:
                VERTEX,
                GEOMETRY,
                FRAGMENT,
+               COMPUTE,
                MAX_STAGES
        };
 
-       struct TransientData
-       {
-               std::map<std::string, unsigned> textures;
-               std::map<std::string, unsigned> blocks;
-       };
-
        struct UniformCall
        {
                using FuncPtr = void (*)(unsigned, unsigned, const void *);
@@ -52,17 +47,18 @@ protected:
 
        bool has_stages() const;
        unsigned add_stage(Stage);
-       void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &, TransientData &);
+       void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &);
        void compile_glsl_stage(const GlslModule &, unsigned);
        void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
 
-       void finalize(const Module &, TransientData &);
+       void link(const Module &);
        void query_uniforms();
        void query_uniform_blocks(const std::vector<ReflectData::UniformInfo *> &);
        void query_attributes();
-       void apply_bindings(const TransientData &);
        void finalize_uniforms();
 
+       bool is_compute() const { return stage_ids[COMPUTE]; }
+
        void set_debug_name(const std::string &);
        void set_stage_debug_name(unsigned, Stage);
 };