+ const SpirVModule::Variable &v = variables[i];
+ if((v.storage==SpirVModule::UNIFORM || v.storage==SpirVModule::PUSH_CONSTANT) && v.struct_type)
+ {
+ reflect_data.uniform_blocks.push_back(ReflectData::UniformBlockInfo());
+ ReflectData::UniformBlockInfo &info = reflect_data.uniform_blocks.back();
+ info.name = v.struct_type->name;
+ if(v.storage==SpirVModule::PUSH_CONSTANT)
+ info.bind_point = ReflectData::PUSH_CONSTANT;
+ else
+ {
+ if(v.binding>=0)
+ info.bind_point = v.binding | (v.descriptor_set<<20);
+ else
+ info.bind_point = ReflectData::DEFAULT_BLOCK;
+ n_descriptor_sets = max(n_descriptor_sets, v.descriptor_set+1);
+ }
+ info.data_size = v.struct_type->size;
+
+ string prefix;
+ if(!v.name.empty())
+ prefix = v.struct_type->name+".";
+ block_uniform_names.push_back(vector<string>());
+ collect_block_uniforms(*v.struct_type, prefix, 0, block_uniform_names.back());
+ }
+ else if(v.storage==SpirVModule::UNIFORM_CONSTANT && (v.location>=0 || v.binding>=0))
+ {
+ block_uniform_names[0].push_back(v.name);
+ reflect_data.uniforms.push_back(ReflectData::UniformInfo());
+ ReflectData::UniformInfo &info = reflect_data.uniforms.back();
+ info.name = v.name;
+ info.tag = v.name;
+ info.location = v.location;
+ if(v.binding>=0)
+ info.binding = v.binding | (v.descriptor_set<<20);
+ n_descriptor_sets = max(n_descriptor_sets, v.descriptor_set+1);
+ info.array_size = max(v.array_size, 1U);
+ info.type = v.type;