GPGMM
GPGMM, a General-Purpose GPU Memory Management Library
Loading...
Searching...
No Matches
Public Attributes | List of all members
gpgmm::vk::GpAllocatorCreateInfo Struct Reference

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.
 

Detailed Description

Used to create allocator.

Member Data Documentation

◆ device

VkDevice gpgmm::vk::GpAllocatorCreateInfo::device

Handle to Vulkan device object.

◆ flags

GpAllocatorCreateFlags gpgmm::vk::GpAllocatorCreateInfo::flags

Flags used to configure allocator.

◆ instance

VkInstance gpgmm::vk::GpAllocatorCreateInfo::instance

Handle to Vulkan instance object.

◆ memoryFragmentationLimit

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.

◆ memoryGrowthFactor

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).

◆ physicalDevice

VkPhysicalDevice gpgmm::vk::GpAllocatorCreateInfo::physicalDevice

Handle to Vulkan physical device object.

◆ poolAlgorithm

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.

◆ preferredDeviceMemorySize

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.

◆ pVulkanFunctions

const VulkanFunctions* gpgmm::vk::GpAllocatorCreateInfo::pVulkanFunctions = nullptr

Function pointer to Vulkan functions.

There are 3 ways to specify Vulkan functions.

  1. Specify gpgmm_vk_static_functions = true and statically link agaisn't the Vulkan loader provided by GPGMM.
  2. Load Vulkan functions dynamically by specifying gpgmm_vk_static_functions = false and ONLY provide the instance and device functions, vkGetInstanceProcAddr and vkGetDeviceProcAddr. GPGMM will use those to load the remaining.
  3. Specify ALL the Vulkan functions. GPGMM will not import or load Vulkan function itself.

◆ subAllocationAlgorithm

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.

◆ vulkanApiVersion

uint32_t gpgmm::vk::GpAllocatorCreateInfo::vulkanApiVersion

Vulkan version return by VK_MAKE_VERSION.


The documentation for this struct was generated from the following file: