X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Fprogram.cpp;h=0b07da8e501e2a959d826dd4441347353223f27c;hb=e0d9f85a9e4554f2bbf4354aa37ad6ae46aef718;hp=64e1ae30f4a9a38f0b749cb82109a3f5c8576a50;hpb=165d43beb32ecf92b1433e87087729f7289dceea;p=libs%2Fgl.git diff --git a/source/core/program.cpp b/source/core/program.cpp index 64e1ae30..0b07da8e 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -57,12 +57,18 @@ void Program::collect_uniforms(const SpirVModule &mod) for(const SpirVModule::Variable &v: mod.get_variables()) { - if(v.storage==SpirVModule::UNIFORM && v.struct_type) + 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; - info.bind_point = v.binding; + if(v.storage==SpirVModule::PUSH_CONSTANT) + info.bind_point = ReflectData::PUSH_CONSTANT; + else + { + info.bind_point = v.binding; + info.descriptor_set = v.descriptor_set; + } info.data_size = v.struct_type->size; string prefix; @@ -80,6 +86,7 @@ void Program::collect_uniforms(const SpirVModule &mod) info.tag = v.name; info.location = v.location; info.binding = v.binding; + info.descriptor_set = v.descriptor_set; info.array_size = max(v.array_size, 1U); info.type = v.type; } @@ -87,6 +94,12 @@ void Program::collect_uniforms(const SpirVModule &mod) sort_member(reflect_data.uniforms, &ReflectData::UniformInfo::tag); + if(block_uniform_names.front().empty()) + { + reflect_data.uniform_blocks.erase(reflect_data.uniform_blocks.begin()); + block_uniform_names.erase(block_uniform_names.begin()); + } + for(unsigned i=0; i