mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-22 12:55:40 +01:00
Add OpLoad
This commit is contained in:
parent
97825750a3
commit
01c658b891
@ -200,6 +200,10 @@ class Module {
|
|||||||
Ref Variable(Ref result_type, spv::StorageClass storage_class,
|
Ref Variable(Ref result_type, spv::StorageClass storage_class,
|
||||||
Ref initializer = nullptr);
|
Ref initializer = nullptr);
|
||||||
|
|
||||||
|
/// Load through a pointer.
|
||||||
|
Ref Load(Ref result_type, Ref pointer,
|
||||||
|
std::optional<spv::MemoryAccessMask> memory_access = {});
|
||||||
|
|
||||||
/// Create a pointer into a composite object that can be used with OpLoad
|
/// Create a pointer into a composite object that can be used with OpLoad
|
||||||
/// and OpStore.
|
/// and OpStore.
|
||||||
Ref AccessChain(Ref result_type, Ref base,
|
Ref AccessChain(Ref result_type, Ref base,
|
||||||
|
@ -20,6 +20,16 @@ Ref Module::Variable(Ref result_type, spv::StorageClass storage_class,
|
|||||||
return AddCode(op);
|
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,
|
Ref Module::AccessChain(Ref result_type, Ref base,
|
||||||
const std::vector<Ref>& indexes) {
|
const std::vector<Ref>& indexes) {
|
||||||
assert(indexes.size() > 0);
|
assert(indexes.size() > 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user