diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 221e9e2..0bf30ee 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -106,7 +106,16 @@ Additional notes
While using defragmentation, you may experience validation layer warnings, which you just need to ignore. See Validation layer warnings.
If you defragment allocations bound to images, these images should be created with VK_IMAGE_CREATE_ALIAS_BIT
flag, to make sure that new image created with same parameters and pointing to data copied to another memory region will interpret its contents consistently. Otherwise you may experience corrupted data on some implementations, e.g. due to different pixel swizzling used internally by the graphics driver.
If you defragment allocations bound to images, new images to be bound to new memory region after defragmentation should be created with VK_IMAGE_LAYOUT_PREINITIALIZED
and then transitioned to their original layout from before defragmentation using an image memory barrier.
Please don't expect memory to be fully compacted after defragmentation. Algorithms inside are based on some heuristics that try to maximize number of Vulkan memory blocks to make totally empty to release them, as well as to maximimze continuous empty space inside remaining blocks, while minimizing the number and size of allocations that needs to be moved. Some fragmentation may still remain after this call. This is normal.
+Please don't expect memory to be fully compacted after defragmentation. Algorithms inside are based on some heuristics that try to maximize number of Vulkan memory blocks to make totally empty to release them, as well as to maximimze continuous empty space inside remaining blocks, while minimizing the number and size of allocations that need to be moved. Some fragmentation may still remain - this is normal.
+If you want to implement your own, custom defragmentation algorithm, there is infrastructure prepared for that, but it is not exposed through the library API - you need to hack its source code. Here are steps needed to do this:
+VmaDefragmentationAlgorithm
and implement your version of its pure virtual method. See definition and comments of this class for details.VmaBlockMetadata_Generic
.VmaBlockVectorDefragmentationContext::Begin
to create object of your new class whenever needed.