#include <map>
#include <string>
#include <vector>
+#include <msp/core/noncopyable.h>
#include "reflectdata.h"
namespace Msp {
namespace GL {
-class OpenGLProgram
+class OpenGLProgram: public NonCopyable
{
friend class OpenGLPipelineState;
{
std::map<std::string, unsigned> textures;
std::map<std::string, unsigned> blocks;
- std::map<unsigned, int> spec_values;
};
struct UniformCall
UniformCall(unsigned l, unsigned s, FuncPtr f): location(l), size(s), func(f) { }
};
- unsigned id;
- unsigned stage_ids[MAX_STAGES];
- bool linked;
+ unsigned id = 0;
+ unsigned stage_ids[MAX_STAGES] = { };
+ bool linked = false;
std::vector<UniformCall> uniform_calls;
std::string debug_name;
OpenGLProgram();
+ OpenGLProgram(OpenGLProgram &&);
~OpenGLProgram();
bool has_stages() const;
unsigned add_stage(Stage);
void add_glsl_stages(const GlslModule &, const std::map<std::string, int> &, TransientData &);
void compile_glsl_stage(const GlslModule &, unsigned);
- void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &, TransientData &);
+ void add_spirv_stages(const SpirVModule &, const std::map<std::string, int> &);
- void finalize(const Module &);
+ void finalize(const Module &, TransientData &);
void query_uniforms();
void query_uniform_blocks(const std::vector<ReflectData::UniformInfo *> &);
void query_attributes();
void apply_bindings(const TransientData &);
+ void finalize_uniforms();
void set_debug_name(const std::string &);
void set_stage_debug_name(unsigned, Stage);