Struct rutabaga_gfx::rutabaga_gralloc::gralloc::RutabagaGralloc
source · pub struct RutabagaGralloc {
grallocs: BTreeMap<GrallocBackend, Box<dyn Gralloc>>,
}
Expand description
A container for a variety of allocation backends.
Fields§
§grallocs: BTreeMap<GrallocBackend, Box<dyn Gralloc>>
Implementations§
source§impl RutabagaGralloc
impl RutabagaGralloc
sourcepub fn new(
flags: RutabagaGrallocBackendFlags
) -> RutabagaResult<RutabagaGralloc>
pub fn new( flags: RutabagaGrallocBackendFlags ) -> RutabagaResult<RutabagaGralloc>
Returns a new RutabagaGralloc instance upon success. All allocation backends that have been built are initialized. The default system allocator is always initialized.
sourcepub fn supports_external_gpu_memory(&self) -> bool
pub fn supports_external_gpu_memory(&self) -> bool
Returns true if one of the allocation backends supports GPU external memory.
sourcepub fn supports_dmabuf(&self) -> bool
pub fn supports_dmabuf(&self) -> bool
Returns true if one of the allocation backends supports dma_buf.
sourcefn determine_optimal_backend(
&self,
_info: ImageAllocationInfo
) -> GrallocBackend
fn determine_optimal_backend( &self, _info: ImageAllocationInfo ) -> GrallocBackend
Returns the best allocation backend to service a particular request.
sourcepub fn get_image_memory_requirements(
&mut self,
info: ImageAllocationInfo
) -> RutabagaResult<ImageMemoryRequirements>
pub fn get_image_memory_requirements( &mut self, info: ImageAllocationInfo ) -> RutabagaResult<ImageMemoryRequirements>
Returns a image memory requirements for the given info
upon success.
sourcepub fn allocate_memory(
&mut self,
reqs: ImageMemoryRequirements
) -> RutabagaResult<RutabagaHandle>
pub fn allocate_memory( &mut self, reqs: ImageMemoryRequirements ) -> RutabagaResult<RutabagaHandle>
Allocates memory given the particular reqs
upon success.
sourcepub fn import_and_map(
&mut self,
handle: RutabagaHandle,
vulkan_info: VulkanInfo,
size: u64
) -> RutabagaResult<Box<dyn MappedRegion>>
pub fn import_and_map( &mut self, handle: RutabagaHandle, vulkan_info: VulkanInfo, size: u64 ) -> RutabagaResult<Box<dyn MappedRegion>>
Imports the handle
using the given vulkan_info
. Returns a mapping using Vulkano upon
success. Should not be used with minigbm or system gralloc backends.
Auto Trait Implementations§
impl !RefUnwindSafe for RutabagaGralloc
impl Send for RutabagaGralloc
impl !Sync for RutabagaGralloc
impl Unpin for RutabagaGralloc
impl !UnwindSafe for RutabagaGralloc
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more