From: Mikko Rasa Date: Thu, 11 Nov 2021 11:24:29 +0000 (+0200) Subject: Store descriptor set in program reflection data X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0a096b9bc02a67ea4a27645907c6b9d1fbdaae85;p=libs%2Fgl.git Store descriptor set in program reflection data --- diff --git a/source/core/module.h b/source/core/module.h index 16e07053..1c62f340 100644 --- a/source/core/module.h +++ b/source/core/module.h @@ -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; diff --git a/source/core/program.cpp b/source/core/program.cpp index 64e1ae30..72eb03d8 100644 --- a/source/core/program.cpp +++ b/source/core/program.cpp @@ -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; } diff --git a/source/core/reflectdata.h b/source/core/reflectdata.h index 7d1b5acf..2c0d7fe3 100644 --- a/source/core/reflectdata.h +++ b/source/core/reflectdata.h @@ -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 uniforms; LayoutHash layout_hash = 0;