Struct vulkano::buffer::cpu_access::CpuAccessibleBuffer
[−]
[src]
pub struct CpuAccessibleBuffer<T: ?Sized, A = Arc<StdMemoryPool>> where A: MemoryPool { /* 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>>
usage: &Usage,
queue_families: I)
-> Result<Arc<CpuAccessibleBuffer<T>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>
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
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>>
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>>
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>>
len: usize,
usage: &Usage,
queue_families: I)
-> Result<Arc<CpuAccessibleBuffer<[T]>>, OomError> where I: IntoIterator<Item=QueueFamily<'a>>
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>>
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>>
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]
A: MemoryPool
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]
A::Alloc: Debug
impl<T: ?Sized, A> Buffer for CpuAccessibleBuffer<T, A> where T: 'static + Send + Sync,
A: MemoryPool
[src]
A: MemoryPool
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
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]
A: MemoryPool
impl<T: ?Sized, A> TrackedBuffer for CpuAccessibleBuffer<T, A> where T: 'static + Send + Sync,
A: MemoryPool
[src]
A: MemoryPool
type CommandListState = CpuAccessibleBufferClState
State of the buffer in a list of commands. Read more
type FinishedState = CpuAccessibleBufferFinished
State of the buffer in a finished list of commands.
fn initial_state(&self) -> Self::CommandListState
Returns the state of the buffer when it has not yet been used.
fn is_same_buffer<B>(&self, other: &B) -> bool where B: Buffer
Returns true if TODO. Read more
fn is_same_image<I>(&self, other: &I) -> bool where I: Image
Returns true if TODO. Read more