summaryrefslogtreecommitdiffstats
path: root/src/video_core/vulkan_common/vulkan_memory_allocator.h
diff options
context:
space:
mode:
authorReinUsesLisp <reinuseslisp@airmail.cc>2021-01-04 00:51:11 +0100
committerReinUsesLisp <reinuseslisp@airmail.cc>2021-01-15 20:19:39 +0100
commit8f22f5470c4875623f08019cb3d2556048710326 (patch)
tree6f9764c10d9b39b92bc0a7992584ab06fb9563e4 /src/video_core/vulkan_common/vulkan_memory_allocator.h
parentvulkan_memory_allocator: Add "download" memory usage hint (diff)
downloadyuzu-8f22f5470c4875623f08019cb3d2556048710326.tar
yuzu-8f22f5470c4875623f08019cb3d2556048710326.tar.gz
yuzu-8f22f5470c4875623f08019cb3d2556048710326.tar.bz2
yuzu-8f22f5470c4875623f08019cb3d2556048710326.tar.lz
yuzu-8f22f5470c4875623f08019cb3d2556048710326.tar.xz
yuzu-8f22f5470c4875623f08019cb3d2556048710326.tar.zst
yuzu-8f22f5470c4875623f08019cb3d2556048710326.zip
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_memory_allocator.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_memory_allocator.h17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/video_core/vulkan_common/vulkan_memory_allocator.h b/src/video_core/vulkan_common/vulkan_memory_allocator.h
index efb32167a..d4e34c843 100644
--- a/src/video_core/vulkan_common/vulkan_memory_allocator.h
+++ b/src/video_core/vulkan_common/vulkan_memory_allocator.h
@@ -92,13 +92,22 @@ public:
private:
/// Allocates a chunk of memory.
- void AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 type_mask, u64 size);
+ void AllocMemory(VkMemoryPropertyFlags flags, u32 type_mask, u64 size);
/// Tries to allocate a memory commit.
- std::optional<MemoryCommit> TryAllocCommit(const VkMemoryRequirements& requirements,
- VkMemoryPropertyFlags wanted_properties);
+ std::optional<MemoryCommit> TryCommit(const VkMemoryRequirements& requirements,
+ VkMemoryPropertyFlags flags);
- const Device& device; ///< Device handler.
+ /// Returns the fastest compatible memory property flags from a wanted usage.
+ VkMemoryPropertyFlags MemoryPropertyFlags(u32 type_mask, MemoryUsage usage) const;
+
+ /// Returns the fastest compatible memory property flags from the wanted flags.
+ VkMemoryPropertyFlags MemoryPropertyFlags(u32 type_mask, VkMemoryPropertyFlags flags) const;
+
+ /// Returns index to the fastest memory type compatible with the passed requirements.
+ std::optional<u32> FindType(VkMemoryPropertyFlags flags, u32 type_mask) const;
+
+ const Device& device; ///< Device handle.
const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties.
std::vector<std::unique_ptr<MemoryAllocation>> allocations; ///< Current allocations.
};