mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator
synced 2024-11-05 04:10:06 +00:00
Minor fixes around macro VMA_STATIC_VULKAN_FUNCTIONS (thanks @realitix!) #2
This commit is contained in:
parent
0ced0960c4
commit
eaf60ee784
@ -298,13 +298,13 @@ void MyBuffer::EnsureBuffer()
|
||||
</ol>
|
||||
<h1><a class="anchor" id="configuration"></a>
|
||||
Configuration</h1>
|
||||
<p>Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each <code>#include</code> 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 etc. C++ STL is used by default, but changing these allows you to get rid of any STL usage if you want, as many game developers tend to do.</p>
|
||||
<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 etc. C++ STL is used by default, but changing these allows you to get rid of any STL usage if you want, as many game developers tend to do.</p>
|
||||
<h2><a class="anchor" id="config_Vulkan_functions"></a>
|
||||
Pointers to Vulkan functions</h2>
|
||||
<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>
|
||||
<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>
|
||||
<ol type="1">
|
||||
<li>Remove macro <code>VMA_STATIC_VULKAN_FUNCTIONS</code> from "CONFIGURATION SECTION" section.</li>
|
||||
<li>Provide valid pointers through <a class="el" href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd" title="Pointers to Vulkan functions. Can be null if you leave #define VMA_STATIC_VULKAN_FUNCTIONS 1...">VmaAllocatorCreateInfo::pVulkanFunctions</a>.</li>
|
||||
<li>Define <code>VMA_STATIC_VULKAN_FUNCTIONS 0</code>.</li>
|
||||
<li>Provide valid pointers through <a class="el" href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd" title="Pointers to Vulkan functions. Can be null if you leave define VMA_STATIC_VULKAN_FUNCTIONS 1...">VmaAllocatorCreateInfo::pVulkanFunctions</a>.</li>
|
||||
</ol>
|
||||
<h2><a class="anchor" id="custom_memory_allocator"></a>
|
||||
Custom host memory allocator</h2>
|
||||
|
@ -101,7 +101,7 @@ Public Attributes</h2></td></tr>
|
||||
<tr class="memdesc:a31c192aa6cbffa33279f6d9f0c47c44b"><td class="mdescLeft"> </td><td class="mdescRight">Either NULL or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap. <a href="#a31c192aa6cbffa33279f6d9f0c47c44b">More...</a><br /></td></tr>
|
||||
<tr class="separator:a31c192aa6cbffa33279f6d9f0c47c44b"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a3dc197be3227da7338b1643f70db36bd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd">pVulkanFunctions</a></td></tr>
|
||||
<tr class="memdesc:a3dc197be3227da7338b1643f70db36bd"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to Vulkan functions. Can be null if you leave <code>#define VMA_STATIC_VULKAN_FUNCTIONS 1</code>. <a href="#a3dc197be3227da7338b1643f70db36bd">More...</a><br /></td></tr>
|
||||
<tr class="memdesc:a3dc197be3227da7338b1643f70db36bd"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to Vulkan functions. Can be null if you leave define <code>VMA_STATIC_VULKAN_FUNCTIONS 1</code>. <a href="#a3dc197be3227da7338b1643f70db36bd">More...</a><br /></td></tr>
|
||||
<tr class="separator:a3dc197be3227da7338b1643f70db36bd"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
@ -279,9 +279,9 @@ Public Attributes</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Pointers to Vulkan functions. Can be null if you leave <code>#define VMA_STATIC_VULKAN_FUNCTIONS 1</code>. </p>
|
||||
<p>If you leave <code>#define VMA_STATIC_VULKAN_FUNCTIONS 1</code> in configuration section, you can pass null as this member, because the library will fetch pointers to Vulkan functions internally in a static way, like: </p><pre class="fragment">vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
|
||||
</pre><p>Fill this member if you want to provide your own pointers to Vulkan functions, e.g. fetched using <code>vkGetInstanceProcAddr</code> and <code>vkGetDeviceProcAddr</code>. </p>
|
||||
<p>Pointers to Vulkan functions. Can be null if you leave define <code>VMA_STATIC_VULKAN_FUNCTIONS 1</code>. </p>
|
||||
<p>If you leave define <code>VMA_STATIC_VULKAN_FUNCTIONS 1</code> in configuration section, you can pass null as this member, because the library will fetch pointers to Vulkan functions internally in a static way, like: </p><pre class="fragment">vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
|
||||
</pre><p>Fill this member if you want to provide your own pointers to Vulkan functions, e.g. fetched using <code>vkGetInstanceProcAddr()</code> and <code>vkGetDeviceProcAddr()</code>. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
File diff suppressed because one or more lines are too long
@ -373,7 +373,7 @@ The library uses following algorithm for allocation, in order:
|
||||
\section configuration Configuration
|
||||
|
||||
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
|
||||
before each include of this file or change directly in this file to provide
|
||||
your own implementation of basic facilities like assert, `min()` and `max()` functions,
|
||||
mutex etc. C++ STL is used by default, but changing these allows you to get rid
|
||||
of any STL usage if you want, as many game developers tend to do.
|
||||
@ -384,7 +384,7 @@ The library uses Vulkan functions straight from the `vulkan.h` header by default
|
||||
If you want to provide your own pointers to these functions, e.g. fetched using
|
||||
`vkGetInstanceProcAddr()` and `vkGetDeviceProcAddr()`:
|
||||
|
||||
-# Remove macro `VMA_STATIC_VULKAN_FUNCTIONS` from "CONFIGURATION SECTION".
|
||||
-# Define `VMA_STATIC_VULKAN_FUNCTIONS 0`.
|
||||
-# Provide valid pointers through VmaAllocatorCreateInfo::pVulkanFunctions.
|
||||
|
||||
\subsection custom_memory_allocator Custom host memory allocator
|
||||
@ -544,9 +544,9 @@ typedef struct VmaAllocatorCreateInfo
|
||||
value of this limit will be reported instead when using vmaGetMemoryProperties().
|
||||
*/
|
||||
const VkDeviceSize* pHeapSizeLimit;
|
||||
/** \brief Pointers to Vulkan functions. Can be null if you leave `#define VMA_STATIC_VULKAN_FUNCTIONS 1`.
|
||||
/** \brief Pointers to Vulkan functions. Can be null if you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1`.
|
||||
|
||||
If you leave `#define VMA_STATIC_VULKAN_FUNCTIONS 1` in configuration section,
|
||||
If you leave define `VMA_STATIC_VULKAN_FUNCTIONS 1` in configuration section,
|
||||
you can pass null as this member, because the library will fetch pointers to
|
||||
Vulkan functions internally in a static way, like:
|
||||
|
||||
@ -1270,10 +1270,12 @@ internally, like:
|
||||
|
||||
vulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
|
||||
|
||||
Remove this macro if you are going to provide you own pointers to Vulkan
|
||||
functions via VmaAllocatorCreateInfo::pVulkanFunctions.
|
||||
Define to 0 if you are going to provide you own pointers to Vulkan functions via
|
||||
VmaAllocatorCreateInfo::pVulkanFunctions.
|
||||
*/
|
||||
#ifndef VMA_STATIC_VULKAN_FUNCTIONS
|
||||
#define VMA_STATIC_VULKAN_FUNCTIONS 1
|
||||
#endif
|
||||
|
||||
// Define this macro to 1 to make the library use STL containers instead of its own implementation.
|
||||
//#define VMA_USE_STL_CONTAINERS 1
|
||||
@ -6163,7 +6165,7 @@ VmaAllocator_T::~VmaAllocator_T()
|
||||
|
||||
void VmaAllocator_T::ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions)
|
||||
{
|
||||
#if VMA_STATIC_VULKAN_FUNCTIONS
|
||||
#if VMA_STATIC_VULKAN_FUNCTIONS == 1
|
||||
m_VulkanFunctions.vkGetPhysicalDeviceProperties = &vkGetPhysicalDeviceProperties;
|
||||
m_VulkanFunctions.vkGetPhysicalDeviceMemoryProperties = &vkGetPhysicalDeviceMemoryProperties;
|
||||
m_VulkanFunctions.vkAllocateMemory = &vkAllocateMemory;
|
||||
@ -6178,7 +6180,7 @@ void VmaAllocator_T::ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunc
|
||||
m_VulkanFunctions.vkDestroyBuffer = &vkDestroyBuffer;
|
||||
m_VulkanFunctions.vkCreateImage = &vkCreateImage;
|
||||
m_VulkanFunctions.vkDestroyImage = &vkDestroyImage;
|
||||
#endif // #if VMA_STATIC_VULKAN_FUNCTIONS
|
||||
#endif // #if VMA_STATIC_VULKAN_FUNCTIONS == 1
|
||||
|
||||
if(pVulkanFunctions != VMA_NULL)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user