mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-26 00:24:35 +00:00
parent
c238be5070
commit
938b19a8c1
@ -70,6 +70,7 @@ $(function() {
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><p>Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each include of this file or change directly in this file to provide your own implementation of basic facilities like assert, <code>min()</code> and <code>max()</code> functions, mutex, atomic etc. The library uses its own implementation of containers by default, but you can switch to using STL containers instead.</p>
|
||||
<p>For example, define <code>VMA_ASSERT(expr)</code> before including the library to provide custom implementation of the assertion, compatible with your project. By default it is defined to standard C <code>assert(expr)</code> in <code>_DEBUG</code> configuration and empty otherwise.</p>
|
||||
<h1><a class="anchor" id="config_Vulkan_functions"></a>
|
||||
Pointers to Vulkan functions</h1>
|
||||
<p>The library uses Vulkan functions straight from the <code>vulkan.h</code> header by default. If you want to provide your own pointers to these functions, e.g. fetched using <code>vkGetInstanceProcAddr()</code> and <code>vkGetDeviceProcAddr()</code>:</p>
|
||||
@ -86,7 +87,7 @@ Device memory allocation callbacks</h1>
|
||||
<h1><a class="anchor" id="heap_memory_limit"></a>
|
||||
Device heap memory limit</h1>
|
||||
<p>When device memory of certain heap runs out of free space, new allocations may fail (returning error code) or they may succeed, silently pushing some existing memory blocks from GPU VRAM to system RAM (which degrades performance). This behavior is implementation-dependant - it depends on GPU vendor and graphics driver.</p>
|
||||
<p>On AMD cards it can be controlled while creating Vulkan device object by using VK_AMD_memory_allocation_behavior extension, if available.</p>
|
||||
<p>On AMD cards it can be controlled while creating Vulkan device object by using VK_AMD_memory_overallocation_behavior extension, if available.</p>
|
||||
<p>Alternatively, if you want to test how your program behaves with limited amount of Vulkan device memory available without switching your graphics card to one that really has smaller VRAM, you can use a feature of this library intended for this purpose. To do it, fill optional member <a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b" title="Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out o...">VmaAllocatorCreateInfo::pHeapSizeLimit</a>. </p>
|
||||
</div></div><!-- PageDoc -->
|
||||
</div><!-- contents -->
|
||||
|
@ -111,7 +111,7 @@ Allocation algorithm</h1>
|
||||
Features not supported</h1>
|
||||
<p>Features deliberately excluded from the scope of this library:</p>
|
||||
<ul>
|
||||
<li>Data transfer. Uploading (straming) and downloading data of buffers and images between CPU and GPU memory and related synchronization is responsibility of the user.</li>
|
||||
<li>Data transfer. Uploading (straming) and downloading data of buffers and images between CPU and GPU memory and related synchronization is responsibility of the user. Defining some "texture" object that would automatically stream its data from a staging copy in CPU memory to GPU memory would rather be a feature of another, higher-level library implemented on top of VMA.</li>
|
||||
<li>Allocations for imported/exported external memory. They tend to require explicit memory type index and dedicated allocation anyway, so they don't interact with main features of this library. Such special purpose allocations should be made manually, using <code>vkCreateBuffer()</code> and <code>vkAllocateMemory()</code>.</li>
|
||||
<li>Recreation of buffers and images. Although the library has functions for buffer and image creation (<a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a>, <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>), you need to recreate these objects yourself after defragmentation. That's because the big structures <code>VkBufferCreateInfo</code>, <code>VkImageCreateInfo</code> are not stored in <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object.</li>
|
||||
<li>Handling CPU memory allocation failures. When dynamically creating small C++ objects in CPU memory (not Vulkan memory), allocation failures are not checked and handled gracefully, because that would complicate code significantly and is usually not needed in desktop PC applications anyway.</li>
|
||||
|
File diff suppressed because one or more lines are too long
@ -1472,6 +1472,11 @@ mutex, atomic etc.
|
||||
The library uses its own implementation of containers by default, but you can switch to using
|
||||
STL containers instead.
|
||||
|
||||
For example, define `VMA_ASSERT(expr)` before including the library to provide
|
||||
custom implementation of the assertion, compatible with your project.
|
||||
By default it is defined to standard C `assert(expr)` in `_DEBUG` configuration
|
||||
and empty otherwise.
|
||||
|
||||
\section config_Vulkan_functions Pointers to Vulkan functions
|
||||
|
||||
The library uses Vulkan functions straight from the `vulkan.h` header by default.
|
||||
|
Loading…
Reference in New Issue
Block a user