Struct vulkano::buffer::sys::UnsafeBuffer [−][src]
pub struct UnsafeBuffer { /* fields omitted */ }
Expand description
Data storage in a GPU-accessible location.
Implementations
pub unsafe fn new<'a, I>(
device: Arc<Device>,
size: usize,
usage: BufferUsage,
sharing: Sharing<I>,
sparse: Option<SparseLevel>
) -> Result<(UnsafeBuffer, MemoryRequirements), BufferCreationError> where
I: Iterator<Item = u32>,
pub unsafe fn new<'a, I>(
device: Arc<Device>,
size: usize,
usage: BufferUsage,
sharing: Sharing<I>,
sparse: Option<SparseLevel>
) -> Result<(UnsafeBuffer, MemoryRequirements), BufferCreationError> where
I: Iterator<Item = u32>,
Creates a new buffer of the given size.
See the module’s documentation for information about safety.
Panic
- Panics if
sparse.sparse
is false andsparse.sparse_residency
orsparse.sparse_aliased
is true. - Panics if
usage
is empty.
pub unsafe fn bind_memory(
&self,
memory: &DeviceMemory,
offset: usize
) -> Result<(), OomError>
pub unsafe fn bind_memory(
&self,
memory: &DeviceMemory,
offset: usize
) -> Result<(), OomError>
Binds device memory to this buffer.
Returns the buffer the image was created with.
Trait Implementations
Returns a reference to the object.
Auto Trait Implementations
impl RefUnwindSafe for UnsafeBuffer
impl Send for UnsafeBuffer
impl Sync for UnsafeBuffer
impl Unpin for UnsafeBuffer
impl UnwindSafe for UnsafeBuffer
Blanket Implementations
Mutably borrows from an owned value. Read more
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.