Struct vulkano::buffer::BufferSlice [] [src]

pub struct BufferSlice<T: ?Sized, B> { /* fields omitted */ }

A subpart of a buffer.

This object doesn't correspond to any Vulkan object. It exists for API convenience.

Example

Creating a slice:

use vulkano::buffer::BufferSlice;
let _slice = BufferSlice::from(&buffer);

Selecting a slice of a buffer that contains [T]:

use vulkano::buffer::BufferSlice;
let _slice = BufferSlice::from(&buffer).slice(12 .. 14).unwrap();

Methods

impl<T: ?Sized, B> BufferSlice<T, B>
[src]

Returns the buffer that this slice belongs to.

Returns the offset of that slice within the buffer.

Returns the size of that slice in bytes.

Builds a slice that contains an element from inside the buffer.

This method builds an object that represents a slice of the buffer. No actual operation is performed.

Example

TODO

Safety

The object whose reference is passed to the closure is uninitialized. Therefore you must not access the content of the object.

You must return a reference to an element from the parameter. The closure must not panic.

impl<T, B> BufferSlice<[T], B>
[src]

Returns the number of elements in this slice.

Reduces the slice to just one element of the array.

Returns None if out of range.

Reduces the slice to just a range of the array.

Returns None if out of range.

Trait Implementations

impl<T: ?Sized, B> Clone for BufferSlice<T, B> where
    B: Clone
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: ?Sized, B> BufferAccess for BufferSlice<T, B> where
    B: BufferAccess
[src]

Returns the inner information about this buffer.

Returns the size of the buffer in bytes.

Returns true if an access to self (as defined by self_offset and self_size) potentially overlaps the same memory as an access to other (as defined by other_offset and other_size). Read more

Returns a key that uniquely identifies the range given by offset/size. Read more

Locks the resource for usage on the GPU. Returns an error if the lock can't be acquired. Read more

Locks the resource for usage on the GPU. Supposes that the resource is already locked, and simply increases the lock by one. Read more

Unlocks the resource previously acquired with try_gpu_lock or increase_gpu_lock. Read more

Returns the length of the buffer in number of elements. Read more

Builds a BufferSlice object holding the buffer by reference.

Builds a BufferSlice object holding part of the buffer by reference. Read more

Builds a BufferSlice object holding the buffer by value.

Builds a BufferSlice object holding part of the buffer by reference. Read more

Returns true if an access to self (as defined by self_offset and self_size) potentially overlaps the same memory as an access to other (as defined by other_first_layer, other_num_layers, other_first_mipmap and other_num_mipmaps). Read more

Shortcut for conflicts_buffer that compares the whole buffer to another.

Shortcut for conflicts_image that compares the whole buffer to a whole image.

Shortcut for conflict_key that grabs the key of the whole buffer.

impl<T: ?Sized, B> TypedBufferAccess for BufferSlice<T, B> where
    B: BufferAccess
[src]

The type of the content.

impl<T: ?Sized, B> DeviceOwned for BufferSlice<T, B> where
    B: DeviceOwned
[src]

Returns the device that owns Self.

impl<T, B> From<BufferSlice<T, B>> for BufferSlice<[T], B>
[src]

Performs the conversion.