[][src]Struct nannou::frame::raw::AddCommands

pub struct AddCommands<'a> { /* fields omitted */ }

A builder type that allows chaining together commands for the command buffer that will be used to draw to the swapchain image framebuffer associated with this RawFrame.

Methods

impl<'a> AddCommands<'a>[src]

pub fn begin_render_pass<F, C>(
    self,
    framebuffer: F,
    secondary: bool,
    clear_values: C
) -> Result<Self, BeginRenderPassError> where
    F: FramebufferAbstract + RenderPassDescClearValues<C> + Clone + Send + Sync + 'static, 
[src]

Adds a command that enters a render pass.

If secondary is true, then you will only be able to add secondary command buffers while you're inside the first subpass of the render pass. If secondary is false, you will only be able to add inline draw commands and not secondary command buffers.

C must contain exactly one clear value for each attachment in the framebuffer.

You must call this before you can add draw commands.

Documentation taken from the corresponding vulkano method.

pub fn next_subpass(
    self,
    secondary: bool
) -> Result<Self, AutoCommandBufferBuilderContextError>
[src]

Adds a command that jumps to the next subpass of the current render pass.

pub fn end_render_pass(
    self
) -> Result<Self, AutoCommandBufferBuilderContextError>
[src]

Adds a command that ends the current render pass.

This must be called after you went through all the subpasses and before you can add further commands.

pub fn blit_image<S, D>(
    self,
    source: S,
    source_top_left: [i32; 3],
    source_bottom_right: [i32; 3],
    source_base_array_layer: u32,
    source_mip_level: u32,
    destination: D,
    destination_top_left: [i32; 3],
    destination_bottom_right: [i32; 3],
    destination_base_array_layer: u32,
    destination_mip_level: u32,
    layer_count: u32,
    filter: Filter
) -> Result<Self, BlitImageError> where
    S: ImageAccess + Send + Sync + 'static,
    D: ImageAccess + Send + Sync + 'static, 
[src]

Adds a command that blits an image to another.

A blit is similar to an image copy operation, except that the portion of the image that is transferred can be resized. You choose an area of the source and an area of the destination, and the implementation will resize the area of the source so that it matches the size of the area of the destination before writing it.

Blit operations have several restrictions:

  • Blit operations are only allowed on queue families that support graphics operations.
  • The format of the source and destination images must support blit operations, which depends on the Vulkan implementation. Vulkan guarantees that some specific formats must always be supported. See tables 52 to 61 of the specifications.
  • Only single-sampled images are allowed.
  • You can only blit between two images whose formats belong to the same type. The types are: floating-point, signed integers, unsigned integers, depth-stencil.
  • If you blit between depth, stencil or depth-stencil images, the format of both images must match exactly.
  • If you blit between depth, stencil or depth-stencil images, only the Nearest filter is allowed.
  • For two-dimensional images, the Z coordinate must be 0 for the top-left offset and 1 for the bottom-right offset. Same for the Y coordinate for one-dimensional images.
  • For non-array images, the base array layer must be 0 and the number of layers must be 1.

If layer_count is greater than 1, the blit will happen between each individual layer as if they were separate images.

Panic

  • Panics if the source or the destination was not created with device.

Documentation taken from the corresponding vulkano method.

pub fn copy_image<S, D>(
    self,
    source: S,
    source_offset: [i32; 3],
    source_base_array_layer: u32,
    source_mip_level: u32,
    destination: D,
    destination_offset: [i32; 3],
    destination_base_array_layer: u32,
    destination_mip_level: u32,
    extent: [u32; 3],
    layer_count: u32
) -> Result<Self, ()> where
    S: ImageAccess + Send + Sync + 'static,
    D: ImageAccess + Send + Sync + 'static, 
[src]

Adds a command that copies an image to another.

Copy operations have several restrictions:

  • Copy operations are only allowed on queue families that support transfer, graphics, or compute operations.
  • The number of samples in the source and destination images must be equal.
  • The size of the uncompressed element format of the source image must be equal to the compressed element format of the destination.
  • If you copy between depth, stencil or depth-stencil images, the format of both images must match exactly.
  • For two-dimensional images, the Z coordinate must be 0 for the image offsets and 1 for the extent. Same for the Y coordinate for one-dimensional images.
  • For non-array images, the base array layer must be 0 and the number of layers must be 1.

If layer_count is greater than 1, the copy will happen between each individual layer as if they were separate images.

Panic

  • Panics if the source or the destination was not created with device.

Documentation taken from the corresponding vulkano method.

pub fn clear_color_image<I>(
    self,
    image: I,
    color: ClearValue
) -> Result<Self, ClearColorImageError> where
    I: ImageAccess + Send + Sync + 'static, 
[src]

Adds a command that clears all the layers and mipmap levels of a color image with a specific value.

Panic

Panics if color is not a color value.

Documentation taken from the corresponding vulkano method.

pub fn clear_color_image_dimensions<I>(
    self,
    image: I,
    first_layer: u32,
    num_layers: u32,
    first_mipmap: u32,
    num_mipmaps: u32,
    color: ClearValue
) -> Result<Self, ClearColorImageError> where
    I: ImageAccess + Send + Sync + 'static, 
[src]

Adds a command that clears a color image with a specific value.

Panic

Panics if color is not a color value.

pub fn copy_buffer<S, D, T>(
    self,
    source: S,
    destination: D
) -> Result<Self, CopyBufferError> where
    S: TypedBufferAccess<Content = T> + Send + Sync + 'static,
    D: TypedBufferAccess<Content = T> + Send + Sync + 'static,
    T: ?Sized
[src]

Adds a command that copies from a buffer to another.

This command will copy from the source to the destination. If their size is not equal, then the amount of data copied is equal to the smallest of the two.

pub fn copy_buffer_to_image<S, D, Px>(
    self,
    source: S,
    destination: D
) -> Result<Self, CopyBufferImageError> where
    S: TypedBufferAccess<Content = [Px]> + Send + Sync + 'static,
    D: ImageAccess + Send + Sync + 'static,
    Format: AcceptsPixels<Px>, 
[src]

Adds a command that copies from a buffer to an image.

pub fn copy_buffer_to_image_dimensions<S, D, Px>(
    self,
    source: S,
    destination: D,
    offset: [u32; 3],
    size: [u32; 3],
    first_layer: u32,
    num_layers: u32,
    mipmap: u32
) -> Result<Self, CopyBufferImageError> where
    S: TypedBufferAccess<Content = [Px]> + Send + Sync + 'static,
    D: ImageAccess + Send + Sync + 'static,
    Format: AcceptsPixels<Px>, 
[src]

Adds a command that copies from a buffer to an image.

pub fn copy_image_to_buffer<S, D, Px>(
    self,
    source: S,
    destination: D
) -> Result<Self, CopyBufferImageError> where
    S: ImageAccess + Send + Sync + 'static,
    D: TypedBufferAccess<Content = [Px]> + Send + Sync + 'static,
    Format: AcceptsPixels<Px>, 
[src]

Adds a command that copies from an image to a buffer.

pub fn copy_image_to_buffer_dimensions<S, D, Px>(
    self,
    source: S,
    destination: D,
    offset: [u32; 3],
    size: [u32; 3],
    first_layer: u32,
    num_layers: u32,
    mipmap: u32
) -> Result<Self, CopyBufferImageError> where
    S: ImageAccess + Send + Sync + 'static,
    D: TypedBufferAccess<Content = [Px]> + Send + Sync + 'static,
    Format: AcceptsPixels<Px>, 
[src]

Adds a command that copies from an image to a buffer.

pub fn draw<V, Gp, S, Pc>(
    self,
    pipeline: Gp,
    dynamic: &DynamicState,
    vertex_buffer: V,
    sets: S,
    constants: Pc
) -> Result<Self, DrawError> where
    Gp: GraphicsPipelineAbstract + VertexSource<V> + Send + Sync + 'static + Clone,
    S: DescriptorSetsCollection
[src]

Draw once, using the vertex_buffer.

To use only some data in the buffer, wrap it in a vk::BufferSlice.

pub fn draw_indexed<V, Gp, S, Pc, Ib, I>(
    self,
    pipeline: Gp,
    dynamic: &DynamicState,
    vertex_buffer: V,
    index_buffer: Ib,
    sets: S,
    constants: Pc
) -> Result<Self, DrawIndexedError> where
    Gp: GraphicsPipelineAbstract + VertexSource<V> + Send + Sync + 'static + Clone,
    S: DescriptorSetsCollection,
    Ib: BufferAccess + TypedBufferAccess<Content = [I]> + Send + Sync + 'static,
    I: Index + 'static, 
[src]

Draw once, using the vertex_buffer and the index_buffer.

To use only some data in a buffer, wrap it in a vk::BufferSlice.

pub fn fill_buffer<B>(
    self,
    buffer: B,
    data: u32
) -> Result<Self, FillBufferError> where
    B: BufferAccess + Send + Sync + 'static, 
[src]

Adds a command that writes the content of a buffer.

This function is similar to the memset function in C. The data parameter is a number that will be repeatedly written through the entire buffer.

Note: This function is technically safe because buffers can only contain integers or floating point numbers, which are always valid whatever their memory representation is. But unless your buffer actually contains only 32-bits integers, you are encouraged to use this function only for zeroing the content of a buffer by passing 0 for the data.

pub fn update_buffer<B, D>(
    self,
    buffer: B,
    data: D
) -> Result<Self, UpdateBufferError> where
    B: TypedBufferAccess<Content = D> + Send + Sync + 'static,
    D: Send + Sync + 'static, 
[src]

Adds a command that writes data to a buffer.

If data is larger than the buffer, only the part of data that fits is written. If the buffer is larger than data, only the start of the buffer is written.

Auto Trait Implementations

impl<'a> !Send for AddCommands<'a>

impl<'a> !Sync for AddCommands<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Content for T[src]

impl<T> SafeBorrow<T> for T[src]

impl<S> FromSample<S> for S[src]

impl<T, U> ToSample<U> for T where
    U: FromSample<T>, 
[src]

impl<S, T> Duplex<S> for T where
    T: FromSample<S> + ToSample<S>, 
[src]

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.