14 lines
8.3 KiB
HTML
14 lines
8.3 KiB
HTML
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="Implementation agnostic memory allocator for Vulkan like APIs."><title>gpu_alloc - Rust</title><script>if(window.location.protocol!=="file:")document.head.insertAdjacentHTML("beforeend","SourceSerif4-Regular-6b053e98.ttf.woff2,FiraSans-Regular-0fe48ade.woff2,FiraSans-Medium-e1aa3f0a.woff2,SourceCodePro-Regular-8badfe75.ttf.woff2,SourceCodePro-Semibold-aa29a496.ttf.woff2".split(",").map(f=>`<link rel="preload" as="font" type="font/woff2" crossorigin href="../static.files/${f}">`).join(""))</script><link rel="stylesheet" href="../static.files/normalize-9960930a.css"><link rel="stylesheet" href="../static.files/rustdoc-42caa33d.css"><meta name="rustdoc-vars" data-root-path="../" data-static-root-path="../static.files/" data-current-crate="gpu_alloc" data-themes="" data-resource-suffix="" data-rustdoc-version="1.84.0 (9fc6b4312 2025-01-07)" data-channel="1.84.0" data-search-js="search-92e6798f.js" data-settings-js="settings-0f613d39.js" ><script src="../static.files/storage-59e33391.js"></script><script defer src="../crates.js"></script><script defer src="../static.files/main-5f194d8c.js"></script><noscript><link rel="stylesheet" href="../static.files/noscript-893ab5e7.css"></noscript><link rel="alternate icon" type="image/png" href="../static.files/favicon-32x32-6580c154.png"><link rel="icon" type="image/svg+xml" href="../static.files/favicon-044be391.svg"></head><body class="rustdoc mod crate"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle" title="show sidebar"></button></nav><nav class="sidebar"><div class="sidebar-crate"><h2><a href="../gpu_alloc/index.html">gpu_<wbr>alloc</a><span class="version">0.6.0</span></h2></div><div class="sidebar-elems"><ul class="block"><li><a id="all-types" href="all.html">All Items</a></li></ul><section id="rustdoc-toc"><h3><a href="#">Sections</a></h3><ul class="block top-toc"><li><a href="#usage" title="Usage">Usage</a><ul><li><a href="#backends-implementations" title="Backends implementations">Backends implementations</a></li></ul></li></ul><h3><a href="#structs">Crate Items</a></h3><ul class="block"><li><a href="#structs" title="Structs">Structs</a></li><li><a href="#enums" title="Enums">Enums</a></li><li><a href="#traits" title="Traits">Traits</a></li></ul></section><div id="rustdoc-modnav"></div></div></nav><div class="sidebar-resizer"></div><main><div class="width-limiter"><rustdoc-search></rustdoc-search><section id="main-content" class="content"><div class="main-heading"><h1>Crate <span>gpu_alloc</span><button id="copy-path" title="Copy item path to clipboard">Copy item path</button></h1><rustdoc-toolbar></rustdoc-toolbar><span class="sub-heading"><a class="src" href="../src/gpu_alloc/lib.rs.html#1-121">Source</a> </span></div><details class="toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>Implementation agnostic memory allocator for Vulkan like APIs.</p>
|
|
<p>This crate is intended to be used as part of safe API implementations.<br />
|
|
Use with caution. There are unsafe functions all over the place.</p>
|
|
<h2 id="usage"><a class="doc-anchor" href="#usage">§</a>Usage</h2>
|
|
<p>Start with fetching <code>DeviceProperties</code> from <code>gpu-alloc-<backend></code> crate for the backend of choice.<br />
|
|
Then create <code>GpuAllocator</code> instance and use it for all device memory allocations.<br />
|
|
<code>GpuAllocator</code> will take care for all necessary bookkeeping like memory object count limit,
|
|
heap budget and memory mapping.</p>
|
|
<h4 id="backends-implementations"><a class="doc-anchor" href="#backends-implementations">§</a>Backends implementations</h4>
|
|
<p>Backend supporting crates should not depend on this crate.<br />
|
|
Instead they should depend on <code>gpu-alloc-types</code> which is much more stable,
|
|
allowing to upgrade <code>gpu-alloc</code> version without <code>gpu-alloc-<backend></code> upgrade.</p>
|
|
</div></details><h2 id="structs" class="section-header">Structs<a href="#structs" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="struct" href="struct.AllocationFlags.html" title="struct gpu_alloc::AllocationFlags">Allocation<wbr>Flags</a></div><div class="desc docblock-short">Allocation flags</div></li><li><div class="item-name"><a class="struct" href="struct.Config.html" title="struct gpu_alloc::Config">Config</a></div><div class="desc docblock-short">Configuration for <a href="type.GpuAllocator"><code>GpuAllocator</code></a></div></li><li><div class="item-name"><a class="struct" href="struct.DeviceProperties.html" title="struct gpu_alloc::DeviceProperties">Device<wbr>Properties</a></div><div class="desc docblock-short">Properties of the device that will be used for allocating memory objects.</div></li><li><div class="item-name"><a class="struct" href="struct.GpuAllocator.html" title="struct gpu_alloc::GpuAllocator">GpuAllocator</a></div><div class="desc docblock-short">Memory allocator for Vulkan-like APIs.</div></li><li><div class="item-name"><a class="struct" href="struct.MappedMemoryRange.html" title="struct gpu_alloc::MappedMemoryRange">Mapped<wbr>Memory<wbr>Range</a></div><div class="desc docblock-short">Specifies range of the mapped memory region.</div></li><li><div class="item-name"><a class="struct" href="struct.MemoryBlock.html" title="struct gpu_alloc::MemoryBlock">Memory<wbr>Block</a></div><div class="desc docblock-short">Memory block allocated by <code>GpuAllocator</code>.</div></li><li><div class="item-name"><a class="struct" href="struct.MemoryHeap.html" title="struct gpu_alloc::MemoryHeap">Memory<wbr>Heap</a></div><div class="desc docblock-short">Defines memory heap.</div></li><li><div class="item-name"><a class="struct" href="struct.MemoryPropertyFlags.html" title="struct gpu_alloc::MemoryPropertyFlags">Memory<wbr>Property<wbr>Flags</a></div><div class="desc docblock-short">Memory properties type.</div></li><li><div class="item-name"><a class="struct" href="struct.MemoryType.html" title="struct gpu_alloc::MemoryType">Memory<wbr>Type</a></div><div class="desc docblock-short">Defines memory type.</div></li><li><div class="item-name"><a class="struct" href="struct.Request.html" title="struct gpu_alloc::Request">Request</a></div><div class="desc docblock-short">Memory request for allocator.</div></li><li><div class="item-name"><a class="struct" href="struct.UsageFlags.html" title="struct gpu_alloc::UsageFlags">Usage<wbr>Flags</a></div><div class="desc docblock-short">Memory usage type.
|
|
Bits set define intended usage for requested memory.</div></li></ul><h2 id="enums" class="section-header">Enums<a href="#enums" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="enum" href="enum.AllocationError.html" title="enum gpu_alloc::AllocationError">Allocation<wbr>Error</a></div><div class="desc docblock-short">Enumeration of possible errors that may occur during memory allocation.</div></li><li><div class="item-name"><a class="enum" href="enum.Dedicated.html" title="enum gpu_alloc::Dedicated">Dedicated</a></div><div class="desc docblock-short">Hints for allocator to decide on allocation strategy.</div></li><li><div class="item-name"><a class="enum" href="enum.DeviceMapError.html" title="enum gpu_alloc::DeviceMapError">Device<wbr>MapError</a></div><div class="desc docblock-short">Memory mapped error.</div></li><li><div class="item-name"><a class="enum" href="enum.MapError.html" title="enum gpu_alloc::MapError">MapError</a></div><div class="desc docblock-short">Enumeration of possible errors that may occur during memory mapping.</div></li><li><div class="item-name"><a class="enum" href="enum.OutOfMemory.html" title="enum gpu_alloc::OutOfMemory">OutOf<wbr>Memory</a></div><div class="desc docblock-short">Memory exhausted error.</div></li></ul><h2 id="traits" class="section-header">Traits<a href="#traits" class="anchor">§</a></h2><ul class="item-table"><li><div class="item-name"><a class="trait" href="trait.MemoryDevice.html" title="trait gpu_alloc::MemoryDevice">Memory<wbr>Device</a></div><div class="desc docblock-short">Abstract device that can be used to allocate memory objects.</div></li></ul></section></div></main></body></html> |