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;
29 std::map<unsigned, int> spec_values;
34 using FuncPtr = void (*)(unsigned, unsigned, const void *);
40 UniformCall(unsigned l, unsigned s, FuncPtr f): location(l), size(s), func(f) { }
44 unsigned stage_ids[MAX_STAGES] = { };
46 std::vector<UniformCall> uniform_calls;
47 std::string debug_name;
52 bool has_stages() const;
53 unsigned add_stage(Stage);
54 void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &, TransientData &);
55 void compile_glsl_stage(const GlslModule &, unsigned);
56 void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &, TransientData &);
58 void finalize(const Module &);
59 void query_uniforms();
60 void query_uniform_blocks(const std::vector<ReflectData::UniformInfo *> &);
61 void query_attributes();
62 void apply_bindings(const TransientData &);
64 void set_debug_name(const std::string &);
65 void set_stage_debug_name(unsigned, Stage);
68 using ProgramBackend = OpenGLProgram;