diff options
| author | 2020-03-31 20:58:08 -0300 | |
|---|---|---|
| committer | 2020-03-31 21:32:07 -0300 | |
| commit | 3a63ae0658efb061eff35787fe11588fb9e41053 (patch) | |
| tree | eebb155c36381a014c6e2f7ba9951d6c6c802763 | |
| parent | renderer_vulkan/wrapper: Add pool handles (diff) | |
| download | yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.gz yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.tar.xz yuzu-3a63ae0658efb061eff35787fe11588fb9e41053.zip | |
renderer_vulkan/wrapper: Add device memory handle
| -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: | |||
| 600 | void BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const; | 600 | void BindMemory(VkDeviceMemory memory, VkDeviceSize offset) const; |
| 601 | }; | 601 | }; |
| 602 | 602 | ||
| 603 | class DeviceMemory : public Handle<VkDeviceMemory, VkDevice, DeviceDispatch> { | ||
| 604 | using Handle<VkDeviceMemory, VkDevice, DeviceDispatch>::Handle; | ||
| 605 | |||
| 606 | public: | ||
| 607 | u8* Map(VkDeviceSize offset, VkDeviceSize size) const { | ||
| 608 | void* data; | ||
| 609 | Check(dld->vkMapMemory(owner, handle, offset, size, 0, &data)); | ||
| 610 | return static_cast<u8*>(data); | ||
| 611 | } | ||
| 612 | |||
| 613 | void Unmap() const noexcept { | ||
| 614 | dld->vkUnmapMemory(owner, handle); | ||
| 615 | } | ||
| 616 | }; | ||
| 617 | |||
| 603 | class DescriptorPool : public Handle<VkDescriptorPool, VkDevice, DeviceDispatch> { | 618 | class DescriptorPool : public Handle<VkDescriptorPool, VkDevice, DeviceDispatch> { |
| 604 | using Handle<VkDescriptorPool, VkDevice, DeviceDispatch>::Handle; | 619 | using Handle<VkDescriptorPool, VkDevice, DeviceDispatch>::Handle; |
| 605 | 620 | ||