mirror of
https://git.suyu.dev/suyu/sirit.git
synced 2026-01-09 07:59:15 +01:00
Add OpLoad
This commit is contained in:
parent
97825750a3
commit
01c658b891
2 changed files with 14 additions and 0 deletions
|
|
@ -20,6 +20,16 @@ Ref Module::Variable(Ref result_type, spv::StorageClass storage_class,
|
|||
return AddCode(op);
|
||||
}
|
||||
|
||||
Ref Module::Load(Ref result_type, Ref pointer,
|
||||
std::optional<spv::MemoryAccessMask> memory_access) {
|
||||
auto op{new Op(spv::Op::OpLoad, bound++, result_type)};
|
||||
op->Add(pointer);
|
||||
if (memory_access) {
|
||||
AddEnum(op, *memory_access);
|
||||
}
|
||||
return AddCode(op);
|
||||
}
|
||||
|
||||
Ref Module::AccessChain(Ref result_type, Ref base,
|
||||
const std::vector<Ref>& indexes) {
|
||||
assert(indexes.size() > 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue