Struct vulkano::buffer::cpu_access::CpuAccessibleBuffer [] [src]

pub struct CpuAccessibleBuffer<T: ?Sized, A = Arc<StdMemoryPool>> where A: MemoryPool {
    // some fields omitted
}

Buffer whose content is accessible by the CPU.

Methods

impl<T> CpuAccessibleBuffer<T>
[src]

fn new<'a, I>(device: &Arc<Device>, usage: &Usage, queue_families: I) -> Result<Arc<CpuAccessibleBuffer<T>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>

Deprecated

Deprecated. Use from_data instead.

fn from_data<'a, I>(device: &Arc<Device>, usage: &Usage, queue_families: I, data: T) -> Result<Arc<CpuAccessibleBuffer<T>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>, T: Content + 'static

Builds a new buffer with some data in it. Only allowed for sized data.

unsafe fn uninitialized<'a, I>(device: &Arc<Device>, usage: &Usage, queue_families: I) -> Result<Arc<CpuAccessibleBuffer<T>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>

Builds a new uninitialized buffer. Only allowed for sized data.

impl<T> CpuAccessibleBuffer<[T]>
[src]

fn from_iter<'a, I, Q>(device: &Arc<Device>, usage: &Usage, queue_families: Q, data: I) -> Result<Arc<CpuAccessibleBuffer<[T]>>, OomError> where I: ExactSizeIterator<Item=T>, T: Content + 'static, Q: IntoIterator<Item=QueueFamily<'a>>

Builds a new buffer that contains an array T. The initial data comes from an iterator that produces that list of Ts.

fn array<'a, I>(device: &Arc<Device>, len: usize, usage: &Usage, queue_families: I) -> Result<Arc<CpuAccessibleBuffer<[T]>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>

Deprecated

Deprecated. Use uninitialized_array or from_iter instead.

unsafe fn uninitialized_array<'a, I>(device: &Arc<Device>, len: usize, usage: &Usage, queue_families: I) -> Result<Arc<CpuAccessibleBuffer<[T]>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>

Builds a new buffer. Can be used for arrays.

impl<T: ?Sized> CpuAccessibleBuffer<T>
[src]

unsafe fn raw<'a, I>(device: &Arc<Device>, size: usize, usage: &Usage, queue_families: I) -> Result<Arc<CpuAccessibleBuffer<T>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>

Builds a new buffer without checking the size.

Safety

You must ensure that the size that you pass is correct for T.

impl<T: ?Sized, A> CpuAccessibleBuffer<T, A> where A: MemoryPool
[src]

fn device(&self) -> &Arc<Device>

Returns the device used to create this buffer.

fn queue_families(&self) -> Vec<QueueFamily>

Returns the queue families this buffer can be used on.

impl<T: ?Sized, A> CpuAccessibleBuffer<T, A> where T: Content + 'static, A: MemoryPool
[src]

fn read(&self, timeout: Duration) -> Result<ReadLock<T>, FenceWaitError>

Locks the buffer in order to write its content.

If the buffer is currently in use by the GPU, this function will block until either the buffer is available or the timeout is reached. A value of 0 for the timeout is valid and means that the function should never block.

After this function successfully locks the buffer, any attempt to submit a command buffer that uses it will block until you unlock it.

fn write(&self, timeout: Duration) -> Result<WriteLock<T>, FenceWaitError>

Locks the buffer in order to write its content.

If the buffer is currently in use by the GPU, this function will block until either the buffer is available or the timeout is reached. A value of 0 for the timeout is valid and means that the function should never block.

After this function successfully locks the buffer, any attempt to submit a command buffer that uses it will block until you unlock it.

Trait Implementations

impl<T: Debug + ?Sized, A: Debug> Debug for CpuAccessibleBuffer<T, A> where A: MemoryPool, A::Alloc: Debug
[src]

fn fmt(&self, __arg_0: &mut Formatter) -> Result

Formats the value using the given formatter.

impl<T: ?Sized, A> Buffer for CpuAccessibleBuffer<T, A> where T: 'static + Send + Sync, A: MemoryPool
[src]

fn inner(&self) -> &UnsafeBuffer

Returns the inner buffer.

fn blocks(&self, _: Range<usize>) -> Vec<usize>

Given a range, returns the list of blocks which each range is contained in. Read more

fn block_memory_range(&self, _: usize) -> Range<usize>

Returns the range of bytes of the buffer slice used by a block.

fn needs_fence(&self, _: bool, _: Range<usize>) -> Option<bool>

Returns whether accessing a range of this buffer should signal a fence.

fn host_accesses(&self, _: usize) -> bool

Called when a command buffer that uses this buffer is being built. Read more

unsafe fn gpu_access(&self, ranges: &mut Iterator<Item=AccessRange>, submission: &Arc<Submission>) -> GpuAccessResult

fn size(&self) -> usize

impl<T: ?Sized, A> TypedBuffer for CpuAccessibleBuffer<T, A> where T: 'static + Send + Sync, A: MemoryPool
[src]

type Content = T

fn len(&self) -> usize where Self::Content: Content