diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-01 01:58:08 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-01 02:32:07 +0200 |
commit | 3a63ae0658efb061eff35787fe11588fb9e41053 (patch) | |
tree | eebb155c36381a014c6e2f7ba9951d6c6c802763 /src | |
parent | renderer_vulkan/wrapper: Add pool handles (diff) | |
download | yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.gz yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.bz2 yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.lz yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.xz yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.zst yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/video_core/renderer_vulkan/wrapper.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/video_core/renderer_vulkan/wrapper.h b/src/video_core/renderer_vulkan/wrapper.h index d1a355144..16d208649 100644 --- a/src/video_core/renderer_vulkan/wrapper.h +++ b/src/video_core/renderer_vulkan/wrapper.h @@ -600,6 +600,21 @@ public: void BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const; }; +class DeviceMemory : public Handle<VkDeviceMemory, VkDevice, DeviceDispatch> { + using Handle<VkDeviceMemory, VkDevice, DeviceDispatch>::Handle; + +public: + u8* Map(VkDeviceSize offset, VkDeviceSize size) const { + void* data; + Check(dld->vkMapMemory(owner, handle, offset, size, 0, &data)); + return static_cast<u8*>(data); + } + + void Unmap() const noexcept { + dld->vkUnmapMemory(owner, handle); + } +}; + class DescriptorPool : public Handle<VkDescriptorPool, VkDevice, DeviceDispatch> { using Handle<VkDescriptorPool, VkDevice, DeviceDispatch>::Handle; |