Vulkan: Add a memory allocator and hook it up to the texture cache.

This commit is contained in:
DrChat
2017-08-20 20:48:36 -05:00
parent 7e819a4ccb
commit 4e4a1a03c1
4 changed files with 5461 additions and 24 deletions

View File

@@ -24,6 +24,8 @@
#include "xenia/ui/vulkan/vulkan.h"
#include "xenia/ui/vulkan/vulkan_device.h"
#include "third_party/vulkan/vk_mem_alloc.h"
namespace xe {
namespace gpu {
namespace vulkan {
@@ -41,9 +43,8 @@ class TextureCache {
VkFormat format;
VkImage image;
VkImageLayout image_layout;
VkDeviceMemory image_memory;
VkDeviceSize memory_offset;
VkDeviceSize memory_size;
VmaAllocation alloc;
VmaAllocationInfo alloc_info;
VkFramebuffer framebuffer; // Blit target frame buffer.
uintptr_t access_watch_handle;
@@ -187,6 +188,8 @@ class TextureCache {
std::unordered_map<uint64_t, VkDescriptorSet> texture_bindings_;
VkDescriptorSetLayout texture_descriptor_set_layout_ = nullptr;
VmaAllocator mem_allocator_ = nullptr;
ui::vulkan::CircularBuffer staging_buffer_;
ui::vulkan::CircularBuffer wb_staging_buffer_;
std::unordered_map<uint64_t, Texture*> textures_;