Add OpCompositeConstruct
This commit is contained in:
parent
5830eca337
commit
44043bca56
2 changed files with 12 additions and 0 deletions
|
@ -237,6 +237,10 @@ class Module {
|
||||||
Id OpCompositeExtract(Id result_type, Id composite,
|
Id OpCompositeExtract(Id result_type, Id composite,
|
||||||
const std::vector<Literal>& indexes = {});
|
const std::vector<Literal>& indexes = {});
|
||||||
|
|
||||||
|
/// Construct a new composite object from a set of constituent objects that
|
||||||
|
/// will fully form it.
|
||||||
|
Id OpCompositeConstruct(Id result_type, const std::vector<Id>& ids);
|
||||||
|
|
||||||
// Annotation
|
// Annotation
|
||||||
|
|
||||||
/// Add a decoration to target.
|
/// Add a decoration to target.
|
||||||
|
|
|
@ -69,4 +69,12 @@ Id Module::OpCompositeExtract(Id result_type, Id composite,
|
||||||
return AddCode(std::move(op));
|
return AddCode(std::move(op));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Id Module::OpCompositeConstruct(Id result_type, const std::vector<Id>& ids) {
|
||||||
|
assert(ids.size() >= 1);
|
||||||
|
auto op{std::make_unique<Op>(spv::Op::OpCompositeConstruct, bound++,
|
||||||
|
result_type)};
|
||||||
|
op->Add(ids);
|
||||||
|
return AddCode(std::move(op));
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace Sirit
|
} // namespace Sirit
|
||||||
|
|
Loading…
Reference in a new issue