mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-22 11:45:37 +01:00
Add OpCompositeConstruct
This commit is contained in:
parent
5830eca337
commit
44043bca56
@ -237,6 +237,10 @@ class Module {
|
||||
Id OpCompositeExtract(Id result_type, Id composite,
|
||||
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
|
||||
|
||||
/// Add a decoration to target.
|
||||
|
@ -69,4 +69,12 @@ Id Module::OpCompositeExtract(Id result_type, Id composite,
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user