mirror of
https://github.com/yuzu-emu/sirit.git
synced 2024-11-21 23:35:38 +01:00
memory: Add OpImageTexelPointer
This commit is contained in:
parent
a62c5bbc10
commit
eefca56afd
@ -284,6 +284,9 @@ public:
|
||||
/// Allocate an object in memory, resulting in a copy to it.
|
||||
Id OpVariable(Id result_type, spv::StorageClass storage_class, Id initializer = nullptr);
|
||||
|
||||
/// Form a pointer to a texel of an image. Use of such a pointer is limited to atomic operations.
|
||||
Id OpImageTexelPointer(Id result_type, Id image, Id coordinate, Id sample);
|
||||
|
||||
/// Load through a pointer.
|
||||
Id OpLoad(Id result_type, Id pointer, std::optional<spv::MemoryAccessMask> memory_access = {});
|
||||
|
||||
|
@ -19,6 +19,14 @@ Id Module::OpVariable(Id result_type, spv::StorageClass storage_class, Id initia
|
||||
return code_store.emplace_back(std::move(op)).get();
|
||||
}
|
||||
|
||||
Id Module::OpImageTexelPointer(Id result_type, Id image, Id coordinate, Id sample) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpImageTexelPointer, bound++, result_type)};
|
||||
op->Add(image);
|
||||
op->Add(coordinate);
|
||||
op->Add(sample);
|
||||
return AddCode(std::move(op));
|
||||
}
|
||||
|
||||
Id Module::OpLoad(Id result_type, Id pointer, std::optional<spv::MemoryAccessMask> memory_access) {
|
||||
auto op{std::make_unique<Op>(spv::Op::OpLoad, bound++, result_type)};
|
||||
op->Add(pointer);
|
||||
|
Loading…
Reference in New Issue
Block a user