mirror of
https://github.com/vulkano-rs/vulkano.git
synced 2024-11-22 14:56:42 +00:00
Merge pull request #58 from tomaka/buffer-slice-docs
Add better docs to BufferSlice
This commit is contained in:
commit
8bf2c6c4a2
@ -77,12 +77,27 @@ pub mod view;
|
||||
|
||||
/// A subpart of a buffer.
|
||||
///
|
||||
/// This object doesn't correspond to any Vulkan object. It exists for the programmer's
|
||||
/// convenience.
|
||||
/// This object doesn't correspond to any Vulkan object. It exists for API convenience.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// TODO: example
|
||||
/// Creating a slice:
|
||||
///
|
||||
/// ```no_run
|
||||
/// use vulkano::buffer::BufferSlice;
|
||||
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> =
|
||||
/// unsafe { std::mem::uninitialized() };
|
||||
/// let _slice = BufferSlice::from(&buffer);
|
||||
/// ```
|
||||
///
|
||||
/// Selecting a slice of a buffer that contains `[T]`:
|
||||
///
|
||||
/// ```no_run
|
||||
/// use vulkano::buffer::BufferSlice;
|
||||
/// # let buffer: std::sync::Arc<vulkano::buffer::DeviceLocalBuffer<[u8]>> =
|
||||
/// unsafe { std::mem::uninitialized() };
|
||||
/// let _slice = BufferSlice::from(&buffer).slice(12 .. 14).unwrap();
|
||||
/// ```
|
||||
///
|
||||
#[derive(Clone)]
|
||||
pub struct BufferSlice<'a, T: ?Sized, B: 'a> {
|
||||
|
Loading…
Reference in New Issue
Block a user