mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-08-06 08:10:14 +00:00
Merge 637f7d608d
into 9c99e75939
This commit is contained in:
commit
fbfa043c1f
4 changed files with 19117 additions and 18125 deletions
37231
3rdparty/GPUOpen/include/vk_mem_alloc.h
vendored
37231
3rdparty/GPUOpen/include/vk_mem_alloc.h
vendored
File diff suppressed because it is too large
Load diff
|
@ -832,7 +832,7 @@ namespace vk
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_allocator = std::make_unique<vk::mem_allocator_vma>(*this, pdev);
|
m_allocator = std::make_unique<vk::mem_allocator_vma>(*this, pdev, pdev);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Useful for debugging different VRAM configurations
|
// Useful for debugging different VRAM configurations
|
||||||
|
|
|
@ -157,7 +157,7 @@ namespace vk
|
||||||
: m_device(dev), m_allocation_flags(0)
|
: m_device(dev), m_allocation_flags(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
mem_allocator_vma::mem_allocator_vma(const vk::render_device& dev, VkPhysicalDevice pdev)
|
mem_allocator_vma::mem_allocator_vma(const vk::render_device& dev, VkPhysicalDevice pdev, VkInstance inst)
|
||||||
: mem_allocator_base(dev, pdev)
|
: mem_allocator_base(dev, pdev)
|
||||||
{
|
{
|
||||||
// Initialize stats pool
|
// Initialize stats pool
|
||||||
|
@ -166,6 +166,7 @@ namespace vk
|
||||||
VmaAllocatorCreateInfo allocatorInfo = {};
|
VmaAllocatorCreateInfo allocatorInfo = {};
|
||||||
allocatorInfo.physicalDevice = pdev;
|
allocatorInfo.physicalDevice = pdev;
|
||||||
allocatorInfo.device = dev;
|
allocatorInfo.device = dev;
|
||||||
|
allocatorInfo.instance = inst;
|
||||||
|
|
||||||
std::vector<VkDeviceSize> heap_limits;
|
std::vector<VkDeviceSize> heap_limits;
|
||||||
const auto vram_allocation_limit = g_cfg.video.vk.vram_allocation_limit * 0x100000ull;
|
const auto vram_allocation_limit = g_cfg.video.vk.vram_allocation_limit * 0x100000ull;
|
||||||
|
@ -299,7 +300,7 @@ namespace vk
|
||||||
|
|
||||||
f32 mem_allocator_vma::get_memory_usage()
|
f32 mem_allocator_vma::get_memory_usage()
|
||||||
{
|
{
|
||||||
vmaGetBudget(m_allocator, stats.data());
|
vmaGetHeapBudgets(m_allocator, stats.data());
|
||||||
|
|
||||||
float max_usage = 0.f;
|
float max_usage = 0.f;
|
||||||
for (const auto& info : stats)
|
for (const auto& info : stats)
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace vk
|
||||||
public:
|
public:
|
||||||
using mem_handle_t = void*;
|
using mem_handle_t = void*;
|
||||||
|
|
||||||
mem_allocator_base(const vk::render_device& dev, VkPhysicalDevice /*pdev*/);
|
mem_allocator_base(const vk::render_device& dev, VkPhysicalDevice);
|
||||||
virtual ~mem_allocator_base() = default;
|
virtual ~mem_allocator_base() = default;
|
||||||
|
|
||||||
virtual void destroy() = 0;
|
virtual void destroy() = 0;
|
||||||
|
@ -83,7 +83,7 @@ namespace vk
|
||||||
class mem_allocator_vma : public mem_allocator_base
|
class mem_allocator_vma : public mem_allocator_base
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
mem_allocator_vma(const vk::render_device& dev, VkPhysicalDevice pdev);
|
mem_allocator_vma(const vk::render_device& dev, VkPhysicalDevice pdev, VkInstance inst);
|
||||||
~mem_allocator_vma() override = default;
|
~mem_allocator_vma() override = default;
|
||||||
|
|
||||||
void destroy() override;
|
void destroy() override;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue