|
|
@ -40,11 +40,6 @@ public:
|
|
|
|
/// Commits memory required by the image and binds it.
|
|
|
|
/// Commits memory required by the image and binds it.
|
|
|
|
VKMemoryCommit Commit(const vk::Image& image, bool host_visible);
|
|
|
|
VKMemoryCommit Commit(const vk::Image& image, bool host_visible);
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns true if the memory allocations are done always in host visible and coherent memory.
|
|
|
|
|
|
|
|
bool IsMemoryUnified() const {
|
|
|
|
|
|
|
|
return is_memory_unified;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
private:
|
|
|
|
/// Allocates a chunk of memory.
|
|
|
|
/// Allocates a chunk of memory.
|
|
|
|
bool AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 type_mask, u64 size);
|
|
|
|
bool AllocMemory(VkMemoryPropertyFlags wanted_properties, u32 type_mask, u64 size);
|
|
|
@ -53,12 +48,8 @@ private:
|
|
|
|
VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements,
|
|
|
|
VKMemoryCommit TryAllocCommit(const VkMemoryRequirements& requirements,
|
|
|
|
VkMemoryPropertyFlags wanted_properties);
|
|
|
|
VkMemoryPropertyFlags wanted_properties);
|
|
|
|
|
|
|
|
|
|
|
|
/// Returns true if the device uses an unified memory model.
|
|
|
|
const VKDevice& device; ///< Device handler.
|
|
|
|
static bool GetMemoryUnified(const VkPhysicalDeviceMemoryProperties& properties);
|
|
|
|
const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties.
|
|
|
|
|
|
|
|
|
|
|
|
const VKDevice& device; ///< Device handler.
|
|
|
|
|
|
|
|
const VkPhysicalDeviceMemoryProperties properties; ///< Physical device properties.
|
|
|
|
|
|
|
|
const bool is_memory_unified; ///< True if memory model is unified.
|
|
|
|
|
|
|
|
std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations.
|
|
|
|
std::vector<std::unique_ptr<VKMemoryAllocation>> allocations; ///< Current allocations.
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|