Add OpMemberDecorate

This commit is contained in:
ReinUsesLisp 2018-10-28 05:38:10 -03:00
parent 3f845b7c48
commit 8f8115d397
2 changed files with 13 additions and 0 deletions

View file

@ -203,6 +203,9 @@ class Module {
Ref Decorate(Ref target, spv::Decoration decoration,
const std::vector<Operand*>& literals = {});
Ref MemberDecorate(Ref structure_type, Operand* member, spv::Decoration decoration,
const std::vector<Operand*>& literals = {});
// Literals
static Operand* Literal(std::uint32_t value);
static Operand* Literal(std::uint64_t value);

View file

@ -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<Operand*>& 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