#include "shared/shared.h"
#include <vulkan/vulkan.h>
#include <assert.h>
#include "device_memory_allocator.h"
#include "buddy_allocator.h"
#include "vkpt.h"
Go to the source code of this file.
◆ ALLOCATOR_BLOCK_SIZE
#define ALLOCATOR_BLOCK_SIZE 1024 |
◆ ALLOCATOR_CAPACITY
#define ALLOCATOR_CAPACITY 33554432 |
◆ DeviceMemoryAllocator
◆ SubAllocator
◆ allocate_device_memory()
◆ create_device_memory_allocator()
◆ create_sub_allocator()
Definition at line 125 of file device_memory_allocator.c.
129 VkMemoryAllocateInfo memory_allocate_info = {
130 .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO,
132 .memoryTypeIndex = memory_type
135 #ifdef VKPT_DEVICE_GROUPS
136 VkMemoryAllocateFlagsInfoKHR mem_alloc_flags = {
137 .sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_FLAGS_INFO_KHR,
138 .flags = VK_MEMORY_ALLOCATE_DEVICE_MASK_BIT_KHR,
143 memory_allocate_info.pNext = &mem_alloc_flags;
147 const VkResult result = vkAllocateMemory(allocator->
device, &memory_allocate_info, NULL, &sub_allocator->
memory);
148 if (result != VK_SUCCESS)
Referenced by allocate_device_memory().
◆ destroy_device_memory_allocator()
◆ free_device_memory()