mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-25 18:45:38 +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,
|
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 New Issue
Block a user