Trait vulkano::buffer::traits::Buffer [] [src]

pub unsafe trait Buffer: 'static + Send + Sync {
    fn inner(&self) -> &UnsafeBuffer;
    fn needs_fence(&self, write: bool, Range<usize>) -> Option<bool>;
    fn host_accesses(&self, block: usize) -> bool;
    fn blocks(&self, range: Range<usize>) -> Vec<usize>;
    fn block_memory_range(&self, block: usize) -> Range<usize>;
    unsafe fn gpu_access(&self, ranges: &mut Iterator<Item=AccessRange>, submission: &Arc<Submission>) -> GpuAccessResult;

    fn size(&self) -> usize { ... }
}

Required Methods

Returns the inner buffer.

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

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

Must return true if the command buffer should include a pipeline barrier at the start, to read from what the host wrote, and a pipeline barrier at the end, to flush caches and allows the host to read the data.

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

Each block must have a unique number. Hint: it can simply be the offset of the start of the block. Calling this function multiple times with the same parameter must always return the same value. The return value must not be empty.

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

If the host is still accessing the buffer, this function implementation should block until it is no longer the case.

Important: The Submission object likely holds an Arc to self. Therefore you should store the Submission in the form of a Weak<Submission> and not of an Arc<Submission> to avoid cyclic references.

Provided Methods

Implementors