GPGMM
GPGMM, a General-Purpose GPU Memory Management Library
|
Used to create allocator. More...
#include <gpgmm_vk.h>
Public Attributes | |
const VulkanFunctions * | pVulkanFunctions = nullptr |
Function pointer to Vulkan functions. | |
VkPhysicalDevice | physicalDevice |
Handle to Vulkan physical device object. | |
VkDevice | device |
Handle to Vulkan device object. | |
VkInstance | instance |
Handle to Vulkan instance object. | |
uint32_t | vulkanApiVersion |
Vulkan version return by VK_MAKE_VERSION. | |
GpAllocatorCreateFlags | flags |
Flags used to configure allocator. | |
GpAllocatorAlgorithm | subAllocationAlgorithm = GP_ALLOCATOR_ALGORITHM_SLAB |
Specifies the algorithm to use for sub-allocation. | |
GpAllocatorAlgorithm | poolAlgorithm = GP_ALLOCATOR_ALGORITHM_SEGMENTED_POOL |
Specifies the algorithm to use for device memory pooling. | |
uint64_t | preferredDeviceMemorySize |
Specifies the preferred size of device memory. | |
float | memoryFragmentationLimit |
Memory fragmentation limit, expressed as a percentage of the device memory size, that is acceptable to be wasted due to fragmentation. | |
float | memoryGrowthFactor |
Memory growth factor, expressed as a multipler of the device memory size that will monotonically increase. | |
Used to create allocator.
VkDevice gpgmm::vk::GpAllocatorCreateInfo::device |
Handle to Vulkan device object.
GpAllocatorCreateFlags gpgmm::vk::GpAllocatorCreateInfo::flags |
Flags used to configure allocator.
VkInstance gpgmm::vk::GpAllocatorCreateInfo::instance |
Handle to Vulkan instance object.
float gpgmm::vk::GpAllocatorCreateInfo::memoryFragmentationLimit |
Memory fragmentation limit, expressed as a percentage of the device memory size, that is acceptable to be wasted due to fragmentation.
Fragmentation occurs when the allocation is larger then the resource size. This occurs when the type of resource (buffer or texture) and allocator have different alignment requirements. For example, a 192KB resource may need to allocate 256KB of allocated space, which is equivalent to a fragmentation limit of 33%.
When |preferredDeviceMemorySize| is non-zero, the memoryFragmentationLimit could be exceeded. Also, the memoryFragmentationLimit should never be zero, as some fragmentation can occur.
Optional parameter. When 0 is specified, the default fragmentation limit is 1/8th the device memory size.
float gpgmm::vk::GpAllocatorCreateInfo::memoryGrowthFactor |
Memory growth factor, expressed as a multipler of the device memory size that will monotonically increase.
A factor value of 1.0 specifies no growth, where the device memory size is always determined by other limits or constraints. If no factor gets specified (or a value less than 1 is specified), GPGMM will allocate a device memory size with enough space to fit exactly one resource.
Memory growth avoids the need to specify |preferredDeviceMemorySize|, which especially helps in situations where the resource size cannot be predicated (eg. user-defined), by allowing the device memory size to gradually increase in size per demand to achieve a balance of memory usage and performance.
Optional parameter. When 0 is specified, the default of 1.25 is used (or 25% growth).
VkPhysicalDevice gpgmm::vk::GpAllocatorCreateInfo::physicalDevice |
Handle to Vulkan physical device object.
GpAllocatorAlgorithm gpgmm::vk::GpAllocatorCreateInfo::poolAlgorithm = GP_ALLOCATOR_ALGORITHM_SEGMENTED_POOL |
Specifies the algorithm to use for device memory pooling.
Used to evaluate how allocation implementations perform with various algorithms that sub-divide device memorys.
Optional parameter. By default, the slab allocator is used.
uint64_t gpgmm::vk::GpAllocatorCreateInfo::preferredDeviceMemorySize |
Specifies the preferred size of device memory.
The preferred size of the device memory is the minimum memory size to sub-allocate from. A larger device memory consumes more memory but could be faster for sub-allocation.
Optional parameter. When 0 is specified, the API will automatically set the preferred device memory size to be a multiple of minimum device memory size allowed by Vulkan.
const VulkanFunctions* gpgmm::vk::GpAllocatorCreateInfo::pVulkanFunctions = nullptr |
Function pointer to Vulkan functions.
There are 3 ways to specify Vulkan functions.
gpgmm_vk_static_functions = true
and statically link agaisn't the Vulkan loader provided by GPGMM.gpgmm_vk_static_functions = false
and ONLY provide the instance and device functions, vkGetInstanceProcAddr
and vkGetDeviceProcAddr
. GPGMM will use those to load the remaining.GpAllocatorAlgorithm gpgmm::vk::GpAllocatorCreateInfo::subAllocationAlgorithm = GP_ALLOCATOR_ALGORITHM_SLAB |
Specifies the algorithm to use for sub-allocation.
Used to evaluate how allocation implementations perform with various algorithms that sub-divide devie memory.
Optional parameter. By default, the slab allocator is used.
uint32_t gpgmm::vk::GpAllocatorCreateInfo::vulkanApiVersion |
Vulkan version return by VK_MAKE_VERSION.