From 7a1056eb9f0c46b4f8b723f6e3f74e8166a45ab4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 10 Nov 2021 22:09:38 +0200 Subject: [PATCH] Emit descriptor set decorations for interface blocks --- source/glsl/spirv.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/glsl/spirv.cpp b/source/glsl/spirv.cpp index c9062efa..20345e20 100644 --- a/source/glsl/spirv.cpp +++ b/source/glsl/spirv.cpp @@ -1717,9 +1717,13 @@ void SpirVGenerator::visit(InterfaceBlock &iface) if(layout_ql) { - auto i = find_member(*layout_ql, string("binding"), &Layout::Qualifier::name); - if(i!=layout_ql->end()) - writer.write_op_decorate(block_id, DECO_BINDING, i->value); + for(const Layout::Qualifier &q: *layout_ql) + { + if(q.name=="set") + writer.write_op_decorate(block_id, DECO_DESCRIPTOR_SET, q.value); + else if(q.name=="binding") + writer.write_op_decorate(block_id, DECO_BINDING, q.value); + } } } -- 2.45.2