]> git.tdb.fi Git - libs/gl.git/commitdiff
Emit descriptor set decorations for interface blocks
authorMikko Rasa <tdb@tdb.fi>
Wed, 10 Nov 2021 20:09:38 +0000 (22:09 +0200)
committerMikko Rasa <tdb@tdb.fi>
Wed, 10 Nov 2021 23:39:41 +0000 (01:39 +0200)
source/glsl/spirv.cpp

index c9062efa12ae7aee7dfb54ca6638d64ca57b3da8..20345e20ae0760de48e4bbea923e89fea7d9356b 100644 (file)
@@ -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);
+               }
        }
 }