]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/program.cpp
Rebind all descriptor sets if push constant layout changes
[libs/gl.git] / source / core / program.cpp
index 881872212bebc224209f020d24aae0b4cc64c485..f8c35ec573ed9b1437ecb63879cca00b00b9d7ff 100644 (file)
@@ -39,7 +39,7 @@ void Program::add_stages(const Module &mod, const map<string, int> &spec_values)
                add_glsl_stages(static_cast<const GlslModule &>(mod), spec_values);
                break;
        case Module::SPIR_V:
-               if(!spec_values.empty())
+               if(static_cast<const SpirVModule &>(mod).is_specializable())
                {
                        specialized_spirv = static_cast<const SpirVModule &>(mod).specialize(spec_values);
                        final_module = specialized_spirv;
@@ -82,8 +82,12 @@ void Program::collect_uniforms(const SpirVModule &mod)
                        reflect_data.uniform_blocks.emplace_back();
                        ReflectData::UniformBlockInfo &info = reflect_data.uniform_blocks.back();
                        info.name = v.struct_type->name;
+                       info.data_size = v.struct_type->size;
                        if(v.storage==SpirVModule::PUSH_CONSTANT)
+                       {
                                info.bind_point = ReflectData::PUSH_CONSTANT;
+                               reflect_data.push_constants_size = info.data_size;
+                       }
                        else
                        {
                                if(v.binding>=0)
@@ -92,7 +96,6 @@ void Program::collect_uniforms(const SpirVModule &mod)
                                        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())