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:

This example is not tested
use vulkano::buffer::BufferSlice;
let _slice = BufferSlice::from(&buffer);

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

This example is not tested
use vulkano::buffer::BufferSlice;
let _slice = BufferSlice::from(&buffer).slice(12 .. 14).unwrap();

Methods

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

[src]

[src]

Returns the buffer that this slice belongs to.

[src]

Returns the offset of that slice within the buffer.

[src]

Returns the size of that slice in bytes.

[src]

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]

[src]

Returns the number of elements in this slice.

[src]

Reduces the slice to just one element of the array.

Returns None if out of range.

[src]

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]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

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

[src]

Returns the inner information about this buffer.

[src]

Returns the size of the buffer in bytes.

[src]

Returns true if an access to self potentially overlaps the same memory as an access to other. Read more

[src]

Returns true if an access to self potentially overlaps the same memory as an access to other. Read more

[src]

Returns a key that uniquely identifies the buffer. Two buffers or images that potentially overlap in memory must return the same key. Read more

[src]

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

[src]

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

[src]

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

[src]

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

[src]

Builds a BufferSlice object holding the buffer by reference.

[src]

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

[src]

Builds a BufferSlice object holding the buffer by value.

[src]

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

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]

[src]

Returns the device that owns Self.

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

[src]

Performs the conversion.

Auto Trait Implementations

impl<T: ?Sized, B> Send for BufferSlice<T, B> where
    B: Send,
    T: Send

impl<T: ?Sized, B> Sync for BufferSlice<T, B> where
    B: Sync,
    T: Sync