diff --git a/include/sirit/sirit.h b/include/sirit/sirit.h index 496ee07..61c21a1 100644 --- a/include/sirit/sirit.h +++ b/include/sirit/sirit.h @@ -203,6 +203,9 @@ class Module { Ref Decorate(Ref target, spv::Decoration decoration, const std::vector& literals = {}); + Ref MemberDecorate(Ref structure_type, Operand* member, spv::Decoration decoration, + const std::vector& literals = {}); + // Literals static Operand* Literal(std::uint32_t value); static Operand* Literal(std::uint64_t value); diff --git a/src/insts/annotation.cpp b/src/insts/annotation.cpp index 28b354e..c54adfc 100644 --- a/src/insts/annotation.cpp +++ b/src/insts/annotation.cpp @@ -18,4 +18,14 @@ Ref Module::Decorate(Ref target, spv::Decoration decoration, return AddAnnotation(op); } +Ref Module::MemberDecorate(Ref structure_type, Operand* member, spv::Decoration decoration, + const std::vector& literals) { + auto op{new Op(spv::Op::OpMemberDecorate)}; + op->Add(structure_type); + op->Sink(member); + AddEnum(op, decoration); + op->Sink(literals); + return AddAnnotation(op); +} + } // namespace Sirit