Struct gpu_allocator::d3d12::Allocator
source · pub struct Allocator { /* private fields */ }
Implementations§
source§impl Allocator
impl Allocator
pub fn device(&self) -> &ID3D12Device
pub fn new(desc: &AllocatorCreateDesc) -> Result<Self>
pub fn allocate(&mut self, desc: &AllocationCreateDesc<'_>) -> Result<Allocation>
pub fn free(&mut self, allocation: Allocation) -> Result<()>
pub fn rename_allocation(
&mut self,
allocation: &mut Allocation,
name: &str
) -> Result<()>
pub fn report_memory_leaks(&self, log_level: Level)
sourcepub fn create_resource(
&mut self,
desc: &ResourceCreateDesc<'_>
) -> Result<Resource>
pub fn create_resource(
&mut self,
desc: &ResourceCreateDesc<'_>
) -> Result<Resource>
Create a resource according to the provided parameters.
Created resources should be freed at the end of their lifetime by calling Self::free_resource()
.
sourcepub fn free_resource(&mut self, resource: Resource) -> Result<()>
pub fn free_resource(&mut self, resource: Resource) -> Result<()>
Free a resource and its memory.