{
for(vector<SpirVModule::StructMember>::const_iterator i=strct.members.begin(); i!=strct.members.end(); ++i)
{
+ unsigned offset = base_offset+i->offset;
if(i->struct_type)
{
if(i->array_size)
{
- for(unsigned j=0; j<i->array_size; ++j)
- collect_block_uniforms(block, *i->struct_type, format("%s%s[%d].", prefix, i->name, j), base_offset+i->offset+i->array_stride*j);
+ for(unsigned j=0; j<i->array_size; ++j, offset+=i->array_stride)
+ collect_block_uniforms(block, *i->struct_type, format("%s%s[%d].", prefix, i->name, j), offset);
}
else
- collect_block_uniforms(block, *i->struct_type, prefix+i->name+".", base_offset+i->offset);
+ collect_block_uniforms(block, *i->struct_type, prefix+i->name+".", offset);
}
else
{
UniformInfo &info = uniforms[name];
info.name = name;
info.block = █
- info.offset = i->offset;
+ info.offset = offset;
info.array_size = i->array_size;
info.array_stride = i->array_stride;
info.matrix_stride = i->matrix_stride;