mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-22 15:04:34 +00:00
350 lines
17 KiB
HTML
350 lines
17 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
|
<meta name="generator" content="Doxygen 1.8.13"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Vulkan Memory Allocator: Layer 2 Allocating Memory</title>
|
|
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="jquery.js"></script>
|
|
<script type="text/javascript" src="dynsections.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Vulkan Memory Allocator
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.8.13 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
</script>
|
|
<div id="main-nav"></div>
|
|
</div><!-- top -->
|
|
<!-- window showing the filter options -->
|
|
<div id="MSearchSelectWindow"
|
|
onmouseover="return searchBox.OnSearchSelectShow()"
|
|
onmouseout="return searchBox.OnSearchSelectHide()"
|
|
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
|
</div>
|
|
|
|
<!-- iframe showing the search results (closed by default) -->
|
|
<div id="MSearchResultsWindow">
|
|
<iframe src="javascript:void(0)" frameborder="0"
|
|
name="MSearchResults" id="MSearchResults">
|
|
</iframe>
|
|
</div>
|
|
|
|
<div class="header">
|
|
<div class="summary">
|
|
<a href="#func-members">Functions</a> </div>
|
|
<div class="headertitle">
|
|
<div class="title">Layer 2 Allocating Memory</div> </div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:gab7d80a26f1059f60c1e3a6999b5f7be1"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#gab7d80a26f1059f60c1e3a6999b5f7be1">vmaAllocateMemory</a> (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> *pVmaMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)</td></tr>
|
|
<tr class="memdesc:gab7d80a26f1059f60c1e3a6999b5f7be1"><td class="mdescLeft"> </td><td class="mdescRight">General purpose memory allocation. <a href="#gab7d80a26f1059f60c1e3a6999b5f7be1">More...</a><br /></td></tr>
|
|
<tr class="separator:gab7d80a26f1059f60c1e3a6999b5f7be1"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gac2d43581abef651398409ed3f71a7b95"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer</a> (VmaAllocator allocator, VkBuffer buffer, const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)</td></tr>
|
|
<tr class="separator:gac2d43581abef651398409ed3f71a7b95"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gad0d2f5b794dd454f0fa5ba308d644af3"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#gad0d2f5b794dd454f0fa5ba308d644af3">vmaAllocateMemoryForImage</a> (VmaAllocator allocator, VkImage image, const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> *pMemoryRequirements, VkMappedMemoryRange *pMemory, uint32_t *pMemoryTypeIndex)</td></tr>
|
|
<tr class="memdesc:gad0d2f5b794dd454f0fa5ba308d644af3"><td class="mdescLeft"> </td><td class="mdescRight">Function similar to <a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer()</a>. <a href="#gad0d2f5b794dd454f0fa5ba308d644af3">More...</a><br /></td></tr>
|
|
<tr class="separator:gad0d2f5b794dd454f0fa5ba308d644af3"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gaf5896cec102b83ca87ae07002d96e230"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#gaf5896cec102b83ca87ae07002d96e230">vmaFreeMemory</a> (VmaAllocator allocator, const VkMappedMemoryRange *pMemory)</td></tr>
|
|
<tr class="memdesc:gaf5896cec102b83ca87ae07002d96e230"><td class="mdescLeft"> </td><td class="mdescRight">Frees memory previously allocated using <a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer()</a> or <a class="el" href="group__layer2.html#gad0d2f5b794dd454f0fa5ba308d644af3" title="Function similar to vmaAllocateMemoryForBuffer(). ">vmaAllocateMemoryForImage()</a>. <a href="#gaf5896cec102b83ca87ae07002d96e230">More...</a><br /></td></tr>
|
|
<tr class="separator:gaf5896cec102b83ca87ae07002d96e230"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ga17739a61a7647553258235e6142c428c"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#ga17739a61a7647553258235e6142c428c">vmaMapMemory</a> (VmaAllocator allocator, const VkMappedMemoryRange *pMemory, void **ppData)</td></tr>
|
|
<tr class="separator:ga17739a61a7647553258235e6142c428c"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:gac2d386fd6ed3b7905892fc77db0b8514"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group__layer2.html#gac2d386fd6ed3b7905892fc77db0b8514">vmaUnmapMemory</a> (VmaAllocator allocator, const VkMappedMemoryRange *pMemory)</td></tr>
|
|
<tr class="separator:gac2d386fd6ed3b7905892fc77db0b8514"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="gab7d80a26f1059f60c1e3a6999b5f7be1"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gab7d80a26f1059f60c1e3a6999b5f7be1">◆ </a></span>vmaAllocateMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VkResult vmaAllocateMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const VkMemoryRequirements * </td>
|
|
<td class="paramname"><em>pVkMemoryRequirements</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> * </td>
|
|
<td class="paramname"><em>pVmaMemoryRequirements</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t * </td>
|
|
<td class="paramname"><em>pMemoryTypeIndex</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>General purpose memory allocation. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">pMemory</td><td>Allocated memory. </td></tr>
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">pMemoryTypeIndex</td><td>Optional. Index of memory type that has been chosen for this allocation.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>You should free the memory using <a class="el" href="group__layer2.html#gaf5896cec102b83ca87ae07002d96e230" title="Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage(). ">vmaFreeMemory()</a>.</p>
|
|
<p>All allocated memory is also automatically freed in <a class="el" href="group__general.html#gaa8d164061c88f22fb1fd3c8f3534bc1d" title="Destroys allocator object. ">vmaDestroyAllocator()</a>.</p>
|
|
<p>It is recommended to use <a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer()</a>, <a class="el" href="group__layer2.html#gad0d2f5b794dd454f0fa5ba308d644af3" title="Function similar to vmaAllocateMemoryForBuffer(). ">vmaAllocateMemoryForImage()</a>, <a class="el" href="group__layer3.html#ga6cafa3a644324a1e0c9165494db11648">vmaCreateBuffer()</a>, <a class="el" href="group__layer3.html#ga9646281a3d9abc9f4d0bc5632db117de" title="Function similar to vmaCreateBuffer(). ">vmaCreateImage()</a> instead whenever possible. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gac2d43581abef651398409ed3f71a7b95"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gac2d43581abef651398409ed3f71a7b95">◆ </a></span>vmaAllocateMemoryForBuffer()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VkResult vmaAllocateMemoryForBuffer </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VkBuffer </td>
|
|
<td class="paramname"><em>buffer</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> * </td>
|
|
<td class="paramname"><em>pMemoryRequirements</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t * </td>
|
|
<td class="paramname"><em>pMemoryTypeIndex</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramdir">[out]</td><td class="paramname">pMemoryTypeIndex</td><td>Optional. Pass null if you don't need this information.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<p>You should free the memory using <a class="el" href="group__layer2.html#gaf5896cec102b83ca87ae07002d96e230" title="Frees memory previously allocated using vmaAllocateMemoryForBuffer() or vmaAllocateMemoryForImage(). ">vmaFreeMemory()</a>.</p>
|
|
<p>All allocated memory is also automatically freed in <a class="el" href="group__general.html#gaa8d164061c88f22fb1fd3c8f3534bc1d" title="Destroys allocator object. ">vmaDestroyAllocator()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gad0d2f5b794dd454f0fa5ba308d644af3"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gad0d2f5b794dd454f0fa5ba308d644af3">◆ </a></span>vmaAllocateMemoryForImage()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VkResult vmaAllocateMemoryForImage </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VkImage </td>
|
|
<td class="paramname"><em>image</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const <a class="el" href="struct_vma_memory_requirements.html">VmaMemoryRequirements</a> * </td>
|
|
<td class="paramname"><em>pMemoryRequirements</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint32_t * </td>
|
|
<td class="paramname"><em>pMemoryTypeIndex</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Function similar to <a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gaf5896cec102b83ca87ae07002d96e230"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gaf5896cec102b83ca87ae07002d96e230">◆ </a></span>vmaFreeMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void vmaFreeMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Frees memory previously allocated using <a class="el" href="group__layer2.html#gac2d43581abef651398409ed3f71a7b95">vmaAllocateMemoryForBuffer()</a> or <a class="el" href="group__layer2.html#gad0d2f5b794dd454f0fa5ba308d644af3" title="Function similar to vmaAllocateMemoryForBuffer(). ">vmaAllocateMemoryForImage()</a>. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ga17739a61a7647553258235e6142c428c"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ga17739a61a7647553258235e6142c428c">◆ </a></span>vmaMapMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">VkResult vmaMapMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void ** </td>
|
|
<td class="paramname"><em>ppData</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<p>Feel free to use vkMapMemory on these memory blocks on you own if you want, but just for convenience and to make sure correct offset and size is always specified, usage of <a class="el" href="group__layer2.html#ga17739a61a7647553258235e6142c428c">vmaMapMemory()</a> / <a class="el" href="group__layer2.html#gac2d386fd6ed3b7905892fc77db0b8514">vmaUnmapMemory()</a> is recommended. </p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="gac2d386fd6ed3b7905892fc77db0b8514"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#gac2d386fd6ed3b7905892fc77db0b8514">◆ </a></span>vmaUnmapMemory()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void vmaUnmapMemory </td>
|
|
<td>(</td>
|
|
<td class="paramtype">VmaAllocator </td>
|
|
<td class="paramname"><em>allocator</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const VkMappedMemoryRange * </td>
|
|
<td class="paramname"><em>pMemory</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
<!-- start footer part -->
|
|
<hr class="footer"/><address class="footer"><small>
|
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
|
</a> 1.8.13
|
|
</small></address>
|
|
</body>
|
|
</html>
|