]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.cpp
Move swizzling modes to pixelformat.h
[libs/gl.git] / source / core / program.cpp
index 64e1ae30f4a9a38f0b749cb82109a3f5c8576a50..8e8455626dc1dc7ab6ced86ba86f0cd2a741f25c 100644 (file)
@@ -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;
                }
@@ -101,6 +108,9 @@ void Program::collect_uniforms(const SpirVModule &mod)
                block.update_layout_hash();
        }
 
+       if(reflect_data.uniform_blocks.front().uniforms.empty())
+               reflect_data.uniform_blocks.erase(reflect_data.uniform_blocks.begin());
+
        reflect_data.update_layout_hash();
 }