uniform_layout_hash = compute_layout_hash(blockless_uniforms);
}
-unsigned Program::compute_layout_hash(const vector<const UniformInfo *> &uniforms)
+Program::LayoutHash Program::compute_layout_hash(const vector<const UniformInfo *> &uniforms)
{
string layout_descriptor;
for(vector<const UniformInfo *>::const_iterator i = uniforms.begin(); i!=uniforms.end(); ++i)
void vertex_shader(const std::string &);
};
+ typedef unsigned LayoutHash;
struct UniformBlockInfo;
struct UniformInfo
unsigned data_size;
unsigned bind_point;
std::vector<const UniformInfo *> uniforms;
- unsigned layout_hash;
+ LayoutHash layout_hash;
};
typedef std::list<Shader *> ShaderList;
bool linked;
UniformBlockMap uniform_blocks;
UniformMap uniforms;
- unsigned uniform_layout_hash;
+ LayoutHash uniform_layout_hash;
bool legacy_vars;
public:
void link();
private:
- static unsigned compute_layout_hash(const std::vector<const UniformInfo *> &);
+ static LayoutHash compute_layout_hash(const std::vector<const UniformInfo *> &);
static bool uniform_location_compare(const UniformInfo *, const UniformInfo *);
public:
bool is_linked() const { return linked; }
std::string get_info_log() const;
- unsigned get_uniform_layout_hash() const { return uniform_layout_hash; }
+ LayoutHash get_uniform_layout_hash() const { return uniform_layout_hash; }
const UniformBlockMap &get_uniform_blocks() const { return uniform_blocks; }
const UniformBlockInfo &get_uniform_block_info(const std::string &) const;
const UniformMap &get_uniforms() const { return uniforms; }
changes = NO_CHANGES;
}
- unsigned layout_hash = (info ? info->layout_hash : prog.get_uniform_layout_hash());
+ Program::LayoutHash layout_hash = (info ? info->layout_hash : prog.get_uniform_layout_hash());
- map<unsigned, Block>::iterator i = blocks.find(layout_hash);
+ map<Program::LayoutHash, Block>::iterator i = blocks.find(layout_hash);
if(i==blocks.end())
{
i = blocks.insert(BlockMap::value_type(layout_hash, Block())).first;
};
typedef std::map<std::string, Uniform *> UniformMap;
- typedef std::map<unsigned, Block> BlockMap;
+ typedef std::map<Program::LayoutHash, Block> BlockMap;
// XXX All these mutables are a bit silly, but I'm out of better ideas
UniformMap uniforms;