[][src]Module vulkano::buffer::view

View of a buffer, in order to use it as a uniform texel buffer or storage texel buffer.

In order to use a buffer as a uniform texel buffer or a storage texel buffer, you have to create a BufferView, which indicates which format the data is in.

In order to create a view from a buffer, the buffer must have been created with either the uniform_texel_buffer or the storage_texel_buffer usage.

Example

use vulkano::buffer::immutable::ImmutableBuffer;
use vulkano::buffer::BufferUsage;
use vulkano::buffer::BufferView;
use vulkano::format;

let usage = BufferUsage {
    storage_texel_buffer: true,
    .. BufferUsage::none()
};

let (buffer, _future) = ImmutableBuffer::<[u32]>::from_iter((0..128).map(|n| n), usage,
                                                            queue.clone()).unwrap();
let _view = BufferView::new(buffer, format::R32Uint).unwrap();

Structs

BufferView

Represents a way for the GPU to interpret buffer data. See the documentation of the view module.

Enums

BufferViewCreationError

Error that can happen when creating a buffer view.

Traits

BufferViewRef