1 #ifndef MSP_GL_PROGRAM_BACKEND_H_
2 #define MSP_GL_PROGRAM_BACKEND_H_
7 #include "reflectdata.h"
14 friend class OpenGLPipelineState;
27 std::map<std::string, unsigned> textures;
28 std::map<std::string, unsigned> blocks;
33 using FuncPtr = void (*)(unsigned, unsigned, const void *);
39 UniformCall(unsigned l, unsigned s, FuncPtr f): location(l), size(s), func(f) { }
43 unsigned stage_ids[MAX_STAGES] = { };
45 std::vector<UniformCall> uniform_calls;
46 std::string debug_name;
51 bool has_stages() const;
52 unsigned add_stage(Stage);
53 void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &, TransientData &);
54 void compile_glsl_stage(const GlslModule &, unsigned);
55 void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
57 void finalize(const Module &, TransientData &);
58 void query_uniforms();
59 void query_uniform_blocks(const std::vector<ReflectData::UniformInfo *> &);
60 void query_attributes();
61 void apply_bindings(const TransientData &);
62 void finalize_uniforms();
64 void set_debug_name(const std::string &);
65 void set_stage_debug_name(unsigned, Stage);
68 using ProgramBackend = OpenGLProgram;