rd.uniforms.emplace_back();
ReflectData::UniformInfo &info = rd.uniforms.back();
- info.name = name;
- info.tag = name;
+ info.tag = info.name = name;
info.array_size = size;
info.type = from_gl_type(type);
uniform_names[i] = name;
rd.blocks.reserve(count+1);
for(unsigned i=0; i<count; ++i)
{
+ rd.blocks.emplace_back();
+ ReflectData::BlockInfo &info = rd.blocks.back();
+
char name[128];
int len;
glGetActiveUniformBlockName(id, i, sizeof(name), &len, name);
- rd.blocks.emplace_back();
- ReflectData::BlockInfo &info = rd.blocks.back();
- info.tag = info.name = name;
+ info.tag = info.name.assign(name, len);
int value;
glGetActiveUniformBlockiv(id, i, GL_UNIFORM_BLOCK_DATA_SIZE, &value);
block_uniform_names[0].push_back(v.name);
reflect_data.uniforms.emplace_back();
ReflectData::UniformInfo &info = reflect_data.uniforms.back();
- info.name = v.name;
- info.tag = v.name;
+ info.tag = info.name = v.name;
info.location = v.location;
if(v.binding>=0)
info.binding = v.binding | (v.descriptor_set<<20);
for(const ProgramBlock &b: programs)
block_hashes.push_back(b.block_index>=0 ? blocks[b.block_index].block_hash : 0);
- for(unsigned j=0; j<block_infos.size(); ++j)
+ unsigned j = index+1;
+ for(const ReflectData::BlockInfo &b: block_infos)
{
- const ReflectData::BlockInfo &info = block_infos[j];
- block_hashes[index+1+j] = info.layout_hash;
- programs[index+1+j].bind_point = info.bind_point;
+ block_hashes[j] = b.layout_hash;
+ programs[j].bind_point = b.bind_point;
+ ++j;
- auto k = lower_bound_member(blocks, info.layout_hash, &SharedBlock::block_hash);
- if(k==blocks.end() || k->block_hash!=info.layout_hash)
+ auto k = lower_bound_member(blocks, b.layout_hash, &SharedBlock::block_hash);
+ if(k==blocks.end() || k->block_hash!=b.layout_hash)
{
- k = blocks.insert(k, SharedBlock(info.layout_hash));
- update_block_uniform_indices(*k, info);
+ k = blocks.insert(k, SharedBlock(b.layout_hash));
+ update_block_uniform_indices(*k, b);
}
}
/* Reassign shared block indices from the stored hashes. */
- for(unsigned j=0; j<programs.size(); ++j)
+ for(j=0; j<programs.size(); ++j)
{
unsigned hash = block_hashes[j];
if(hash)