]> git.tdb.fi Git - libs/gl.git/commitdiff
Store descriptor set in program reflection data
authorMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:24:29 +0000 (13:24 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 11 Nov 2021 11:24:29 +0000 (13:24 +0200)
source/core/module.h
source/core/program.cpp
source/core/reflectdata.h

index 16e07053ea4abd427fac950b0b09da2bb89c6ac9..1c62f340505a254e2fec0d40817c6335e1a49060 100644 (file)
@@ -156,7 +156,7 @@ public:
                const Structure *struct_type = 0;
                unsigned array_size = 0;
                int location = -1;
-               int descriptor_set = -1;
+               int descriptor_set = 0;
                int binding = -1;
                BuiltinSemantic builtin = NOT_BUILTIN;
 
index 64e1ae30f4a9a38f0b749cb82109a3f5c8576a50..72eb03d8d92dcf233ee20a5fddd3d9127d7f6ab4 100644 (file)
@@ -63,6 +63,7 @@ void Program::collect_uniforms(const SpirVModule &mod)
                        ReflectData::UniformBlockInfo &info = reflect_data.uniform_blocks.back();
                        info.name = v.struct_type->name;
                        info.bind_point = v.binding;
+                       info.descriptor_set = v.descriptor_set;
                        info.data_size = v.struct_type->size;
 
                        string prefix;
@@ -80,6 +81,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;
                }
index 7d1b5acf6b745a5aca663dbbf6a6c87828cb9588..2c0d7fe3e1c0765586726a2dfb4acb7e28616cdc 100644 (file)
@@ -31,6 +31,7 @@ struct ReflectData
                unsigned matrix_stride = 0;
                DataType type = VOID;
                Tag tag;
+               int descriptor_set = 0;
                int binding = -1;
        };
 
@@ -38,6 +39,7 @@ struct ReflectData
        {
                std::string name;
                unsigned data_size = 0;
+               int descriptor_set = 0;
                int bind_point = -1;
                std::vector<const UniformInfo *> uniforms;
                LayoutHash layout_hash = 0;