From 8f8115d3977bc8c5ac83238ea3ccdc87d2295bb6 Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sun, 28 Oct 2018 05:38:10 -0300 Subject: [PATCH] Add OpMemberDecorate --- include/sirit/sirit.h | 3 +++ src/insts/annotation.cpp | 10 ++++++++++ 2 files changed, 13 insertions(+) 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