Trait vulkano::command_buffer::CommandBufferBuilder [] [src]

pub unsafe trait CommandBufferBuilder: DeviceOwned {
    fn queue_family(&self) -> QueueFamily;

    fn fill_buffer<B, O>(
        self,
        buffer: B,
        data: u32
    ) -> Result<O, CommandBufferBuilderError<CmdFillBufferError>>
    where
        Self: Sized + AddCommand<CmdFillBuffer<B::Access>, Out = O>,
        B: Buffer
, { ... } fn update_buffer<B, D, O>(
        self,
        buffer: B,
        data: D
    ) -> Result<O, CommandBufferBuilderError<CmdUpdateBufferError>>
    where
        Self: Sized + AddCommand<CmdUpdateBuffer<B::Access, D>, Out = O>,
        B: Buffer + TypedBuffer<Content = D>,
        D: 'static
, { ... } fn copy_buffer<S, D, O>(
        self,
        src: S,
        dest: D
    ) -> Result<O, CommandBufferBuilderError<CmdCopyBufferError>>
    where
        Self: Sized + AddCommand<CmdCopyBuffer<S::Access, D::Access>, Out = O>,
        S: Buffer,
        D: Buffer
, { ... } fn copy_buffer_to_image<B, I, O>(
        self,
        buffer: B,
        image: I
    ) -> Result<O, CommandBufferBuilderError<CmdCopyBufferToImageError>>
    where
        Self: Sized + AddCommand<CmdCopyBufferToImage<B::Access, I::Access>, Out = O>,
        B: Buffer,
        I: Image
, { ... } fn copy_buffer_to_image_dimensions<B, I, O>(
        self,
        buffer: B,
        image: I,
        offset: [u32; 3],
        size: [u32; 3],
        first_layer: u32,
        num_layers: u32,
        mipmap: u32
    ) -> Result<O, CommandBufferBuilderError<CmdCopyBufferToImageError>>
    where
        Self: Sized + AddCommand<CmdCopyBufferToImage<B::Access, I::Access>, Out = O>,
        B: Buffer,
        I: Image
, { ... } fn begin_render_pass<F, C, O>(
        self,
        framebuffer: F,
        secondary: bool,
        clear_values: C
    ) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdBeginRenderPass<Arc<RenderPassAbstract + Send + Sync>, F>, Out = O>,
        F: FramebufferAbstract + RenderPassDescClearValues<C>
, { ... } fn next_subpass<O>(self, secondary: bool) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdNextSubpass, Out = O>
, { ... } fn end_render_pass<O>(self) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdEndRenderPass, Out = O>
, { ... } fn draw<P, S, Pc, V, O>(
        self,
        pipeline: P,
        dynamic: DynamicState,
        vertices: V,
        sets: S,
        push_constants: Pc
    ) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdDraw<V, P, S, Pc>, Out = O>,
        S: DescriptorSetsCollection,
        P: VertexSource<V> + GraphicsPipelineAbstract + Clone
, { ... } fn draw_indexed<P, S, Pc, V, Ib, I, O>(
        self,
        pipeline: P,
        dynamic: DynamicState,
        vertices: V,
        index_buffer: Ib,
        sets: S,
        push_constants: Pc
    ) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdDrawIndexed<V, Ib::Access, P, S, Pc>, Out = O>,
        S: DescriptorSetsCollection,
        P: VertexSource<V> + GraphicsPipelineAbstract + Clone,
        Ib: Buffer,
        Ib::Access: TypedBufferAccess<Content = [I]>,
        I: Index + 'static
, { ... } fn draw_indirect<P, S, Pc, V, B, O>(
        self,
        pipeline: P,
        dynamic: DynamicState,
        vertices: V,
        indirect_buffer: B,
        sets: S,
        push_constants: Pc
    ) -> Result<O, CommandAddError>
    where
        Self: Sized + AddCommand<CmdDrawIndirect<V, B::Access, P, S, Pc>, Out = O>,
        S: DescriptorSetsCollection,
        P: VertexSource<V> + GraphicsPipelineAbstract + Clone,
        B: Buffer,
        B::Access: TypedBufferAccess<Content = [DrawIndirectCommand]>
, { ... } fn dispatch<P, S, Pc, O>(
        self,
        dimensions: [u32; 3],
        pipeline: P,
        sets: S,
        push_constants: Pc
    ) -> Result<O, CommandBufferBuilderError<CmdDispatchError>>
    where
        Self: Sized + AddCommand<CmdDispatch<P, S, Pc>, Out = O>,
        S: DescriptorSetsCollection,
        P: Clone + ComputePipelineAbstract
, { ... } fn build(self) -> Result<Self::Out, Self::Err>
    where
        Self: Sized + CommandBufferBuild
, { ... } fn supports_graphics(&self) -> bool { ... } fn supports_compute(&self) -> bool { ... } }

Note: This trait is just a utility trait. Do not implement it yourself. Instead implement the AddCommand and CommandBufferBuild traits.

Required Methods

Returns the queue family of the command buffer builder.

Provided Methods

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 repeatidely 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.

Adds a command that writes data to a buffer.

Adds a command that copies from a buffer to another.

Adds a command that copies the content of a buffer to an image.

For color images (ie. all formats except depth and/or stencil formats) this command does not perform any conversion. The data inside the buffer must already have the right format. TODO: talk about depth/stencil

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.

Same as copy_buffer_to_image but lets you specify a range for the destination image.

Adds a command that starts 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.

You must call this before you can add draw commands.

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

Adds a command that ends the current render pass.

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

Adds a command that draws.

Can only be used from inside a render pass.

Adds a command that draws indexed vertices.

Can only be used from inside a render pass.

Adds an indirect draw command.

Can only be used from inside a render pass.

Executes a compute shader.

Builds the actual command buffer.

You must call this function after you have finished adding commands to the command buffer builder. A command buffer will returned, which you can then submit or use in an "execute commands" command.

Returns true if the pool of the builder supports graphics operations.

Returns true if the pool of the builder supports compute operations.

Implementors