Trait vulkano::image::traits::Image
[−]
[src]
pub unsafe trait Image: 'static + Send + Sync { fn inner_image(&self) -> &UnsafeImage; fn blocks(&self, mipmap_levels: Range<u32>, array_layers: Range<u32>) -> Vec<(u32, u32)>; fn block_mipmap_levels_range(&self, block: (u32, u32)) -> Range<u32>; fn block_array_layers_range(&self, block: (u32, u32)) -> Range<u32>; fn initial_layout(&self, block: (u32, u32), first_required_layout: Layout) -> (Layout, bool, bool); fn final_layout(&self, block: (u32, u32), last_required_layout: Layout) -> (Layout, bool, bool); fn needs_fence(&self, access: &mut Iterator<Item=AccessRange>) -> Option<bool>; unsafe fn gpu_access(&self, access: &mut Iterator<Item=AccessRange>, submission: &Arc<Submission>) -> GpuAccessResult; fn format(&self) -> Format { ... } fn samples(&self) -> u32 { ... } fn dimensions(&self) -> Dimensions { ... } fn supports_blit_source(&self) -> bool { ... } fn supports_blit_destination(&self) -> bool { ... } }
Required Methods
fn inner_image(&self) -> &UnsafeImage
Returns the inner unsafe image object used by this image.
fn blocks(&self, mipmap_levels: Range<u32>, array_layers: Range<u32>) -> Vec<(u32, u32)>
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 mipmap and array layer. Calling this function multiple times with the same parameter must always return the same value. The return value must not be empty.
fn block_mipmap_levels_range(&self, block: (u32, u32)) -> Range<u32>
fn block_array_layers_range(&self, block: (u32, u32)) -> Range<u32>
fn initial_layout(&self, block: (u32, u32), first_required_layout: Layout) -> (Layout, bool, bool)
Called when a command buffer that uses this image is being built. Given a block, this function should return the layout that the block will have when the command buffer is submitted.
The first_required_layout
is provided as a hint and corresponds to the first layout
that the image will be used for. If this function returns a value different from
first_required_layout
, then a layout transition will be performed by the command buffer.
The two additional elements are:
- Whether a pipeline barrier should be added in order to address a read or write from the host (VK_ACCESS_HOST_READ_BIT | VK_ACCESS_HOST_WRITE_BIT).
- Whether a pipeline barrier should be added in order to address a read or write from memory (VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT).
fn final_layout(&self, block: (u32, u32), last_required_layout: Layout) -> (Layout, bool, bool)
Called when a command buffer that uses this image is being built. Given a block, this function should return the layout that the block must have when the command buffer is end.
The last_required_layout
is provided as a hint and corresponds to the last layout
that the image will be in at the end of the command buffer. If this function returns a
value different from last_required_layout
, then a layout transition will be performed
by the command buffer.
The two additional elements are:
- Whether a pipeline barrier should be added in order to address a read or write from the host (VK_ACCESS_HOST_READ_BIT | VK_ACCESS_HOST_WRITE_BIT).
- Whether a pipeline barrier should be added in order to address a read or write from memory (VK_ACCESS_MEMORY_READ_BIT | VK_ACCESS_MEMORY_WRITE_BIT).
fn needs_fence(&self, access: &mut Iterator<Item=AccessRange>) -> Option<bool>
Returns whether accessing a subresource of that image should signal a fence.
unsafe fn gpu_access(&self, access: &mut Iterator<Item=AccessRange>, submission: &Arc<Submission>) -> GpuAccessResult
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
fn format(&self) -> Format
Returns the format of this image.
fn samples(&self) -> u32
fn dimensions(&self) -> Dimensions
Returns the dimensions of the image.
fn supports_blit_source(&self) -> bool
Returns true if the image can be used as a source for blits.
fn supports_blit_destination(&self) -> bool
Returns true if the image can be used as a destination for blits.
Implementors
impl<F, A> Image for AttachmentImage<F, A> where F: 'static + Send + Sync, A: MemoryPool
impl<F, A> Image for ImmutableImage<F, A> where F: 'static + Send + Sync, A: MemoryPool
impl Image for SwapchainImage