Click or drag to resize
Ab4d.SharpEngine logo

VulkanMemoryAllocator Class

Inheritance Hierarchy
SystemObject
  Ab4d.SharpEngine.CoreComponentBase
    Ab4d.SharpEngine.CoreGpuDeviceComponent
      Ab4d.SharpEngine.UtilitiesVulkanMemoryAllocator

Namespace: Ab4d.SharpEngine.Utilities
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 2.0.8956+4c7684e186ca1be74e7a284fbe739d9a1b843d3c
Syntax
C#
public class VulkanMemoryAllocator : GpuDeviceComponent, 
	IVulkanMemoryAllocator

The VulkanMemoryAllocator type exposes the following members.

Properties
 NameDescription
Public propertyInitialBufferMemoryBlockSize Gets size in bytes that defines the size of the first memory block used for GpuBuffers. The next block that is allocated is twice the size of the previous block. By default this value is set from InitialBufferMemoryBlockSize. User can change this value for this instance of VulkanMemoryAllocator before the first allocation is made.
Public propertyInitialImageMemoryBlockSize Gets size in bytes that defines the size of the first memory block used for GpuImages. The next block that is allocated is twice the size of the previous block. By default this value is set from InitialImageMemoryBlockSize. User can change this value for this instance of VulkanMemoryAllocator before the first allocation is made.
Public propertyMaxAllocatedMemoryBlockSize Gets size in bytes that defines the maximum allocated memory block size (except if a bigger memory block is required). The size of blocks that are allocated is doubled each time a block is allocated. This value defines the size after which the allocated size is not doubled anymore. By default this value is set from MaxAllocatedMemoryBlockSize. User can change this value for this instance of VulkanMemoryAllocator.
Public propertyMaxVulkanMemoryAllocationsCount Returns the maximum number of valid memory allocations that can exist simultaneously within a Device.
Public propertyPeakAllocatedMemory 
Public propertyStoreDisposedAllocationsData When StoreDisposedAllocationsData is true (false by default), then information about disposed allocations is preserved and is shown in the GetReportString(Boolean, Boolean, Boolean) method.
Public propertyTotalAllocatedMemory 
Public propertyTotalAllocationsCount 
Top
Methods
 NameDescription
Public methodAllocateMemory(Buffer, MemoryPropertyFlags, Boolean, String) 
Public methodAllocateMemory(Image, MemoryPropertyFlags, Boolean, String) 
Public methodAllocateMemory(MemoryRequirements, MemoryPropertyFlags, Boolean, Boolean, String) 
Public methodAllocateMemory(UInt32, UInt32, Int32, Boolean, Boolean, String) 
Public methodAllocateMemory(UInt32, UInt32, Int32, Boolean, Boolean, UInt32, String) 
Protected methodAllocateVulkanMemory AllocateVulkanMemory is a protected virtual method that calls the vkAllocateMemory function. The method can be overwritten to provide custom allocation logic.
Public methodCleanup Cleanup method checks all memory blocks. Memory block is freed when it is empty and freeEmptyMemoryBlocks is true or when it empty for at least EngineRuntimeOptions.FramesCountToReleaseEmptyMemoryBlock frames.
Public methodStatic memberCreate 
Protected methodDispose
(Overrides ComponentBaseDispose(Boolean))
Public methodDumpMemoryAllocations Writes string that that describes the allocated memory to the console (when the application is debugged in Visual Studio the string is written to Output window).
Public methodFreeMemory(VulkanMemoryInfo) 
Public methodFreeMemory(Int32, UInt32, String) 
Protected methodFreeVulkanMemory FreeVulkanMemory is a protected virtual method that calls the vkFreeMemory function. The method can be overwritten to provide custom allocation logic.
Protected methodGetNewMemoryBlockSize GetNewMemoryBlockSize is a protected virtual method that returns the size of the allocated memory block based on the memoryTypeIndex, requestedSize (size of a single allocation that lead to the allocation of new memory block) and allocatedMemoryBlocksForThisMemoryType (number of already allocated memory blocks for this memoryTypeIndex). The method can be overwritten to provide custom size calculation logic.
Public methodGetReportString Gets the string that describes the allocated memory.
Top
See Also