Struct vulkano::command_buffer::PrimaryCommandBufferBuilder
[−]
[src]
pub struct PrimaryCommandBufferBuilder { // some fields omitted }
A prototype of a primary command buffer.
Usage
let commands_buffer = PrimaryCommandBufferBuilder::new(&device) .copy_memory(..., ...) .draw(...) .build();
Methods
impl PrimaryCommandBufferBuilder
[src]
fn raw(pool: &Arc<CommandBufferPool>) -> Result<PrimaryCommandBufferBuilder, OomError>
See the docs of new().
fn new(pool: &Arc<CommandBufferPool>) -> PrimaryCommandBufferBuilder
Builds a new primary command buffer and start recording commands in it.
Panic
- Panicks if the device or host ran out of memory.
fn update_buffer<'a, B, T, Bb>(self, buffer: B, data: &T) -> PrimaryCommandBufferBuilder where B: Into<BufferSlice<'a, T, Bb>>, Bb: Buffer + 'static, T: Clone + 'static + Send + Sync
Writes data to a buffer.
The data is stored inside the command buffer and written to the given buffer slice. This function is intended to be used for small amounts of data (only 64kB is allowed). if you want to transfer large amounts of data, use copies between buffers.
Panic
- Panicks if the size of
data
is not the same as the size of the buffer slice. - Panicks if the size of
data
is superior to 65536 bytes. - Panicks if the offset or size is not a multiple of 4.
- Panicks if the buffer wasn't created with the right usage.
- Panicks if the queue family doesn't support transfer operations.
unsafe fn fill_buffer<B>(self, buffer: &Arc<B>, offset: usize, size: usize, data: u32) -> PrimaryCommandBufferBuilder where B: Buffer + 'static
Fills a buffer with data.
The data is repeated until it fills the range from offset
to offset + size
.
Since the data is a u32, the offset and the size must be multiples of 4.
Panic
- Panicks if
offset + data
is superior to the size of the buffer. - Panicks if the offset or size is not a multiple of 4.
- Panicks if the buffer wasn't created with the right usage.
- Panicks if the queue family doesn't support transfer operations.
Safety
- Type safety is not enforced by the API.
fn copy_buffer<T: ?Sized + 'static, Bs, Bd>(self, source: &Arc<Bs>, destination: &Arc<Bd>) -> PrimaryCommandBufferBuilder where Bs: TypedBuffer<Content=T> + 'static, Bd: TypedBuffer<Content=T> + 'static
fn copy_buffer_to_color_image<'a, P, S, Img, Sb>(self, source: S, destination: &Arc<Img>, mip_level: u32, array_layers_range: Range<u32>, offset: [u32; 3], extent: [u32; 3]) -> PrimaryCommandBufferBuilder where S: Into<BufferSlice<'a, [P], Sb>>, Sb: Buffer + 'static, Img: ImageContent<P> + 'static
fn copy_color_image_to_buffer<'a, P, S, Img, Sb>(self, dest: S, destination: &Arc<Img>, mip_level: u32, array_layers_range: Range<u32>, offset: [u32; 3], extent: [u32; 3]) -> PrimaryCommandBufferBuilder where S: Into<BufferSlice<'a, [P], Sb>>, Sb: Buffer + 'static, Img: ImageContent<P> + 'static
fn blit<Si, Di>(self, source: &Arc<Si>, source_mip_level: u32, source_array_layers: Range<u32>, src_coords: [Range<i32>; 3], destination: &Arc<Di>, dest_mip_level: u32, dest_array_layers: Range<u32>, dest_coords: [Range<i32>; 3]) -> PrimaryCommandBufferBuilder where Si: Image + 'static, Di: Image + 'static
fn clear_color_image<'a, I, V>(self, image: &Arc<I>, color: V) -> PrimaryCommandBufferBuilder where I: ImageClearValue<V> + 'static
Note that compressed formats are not supported.
fn execute_commands(self, cb: &Arc<SecondaryComputeCommandBuffer>) -> PrimaryCommandBufferBuilder
Executes secondary compute command buffers within this primary command buffer.
fn dispatch<Pl, L>(self, pipeline: &Arc<ComputePipeline<Pl>>, sets: L, dimensions: [u32; 3]) -> PrimaryCommandBufferBuilder where L: 'static + DescriptorSetsCollection + Send + Sync, Pl: 'static + PipelineLayout + Send + Sync
Executes a compute pipeline.
fn draw_inline<R, F, C>(self, renderpass: &Arc<R>, framebuffer: &Arc<Framebuffer<F>>, clear_values: C) -> PrimaryCommandBufferBuilderInlineDraw where F: RenderPass + RenderPassDesc + RenderPassClearValues<C> + 'static, R: RenderPass + RenderPassDesc + 'static
Start drawing on a framebuffer. This function returns an object that can be used to submit draw commands on the first subpass of the renderpass.
Panic
- Panicks if the framebuffer is not compatible with the renderpass.
fn draw_secondary<R, F, C>(self, renderpass: &Arc<R>, framebuffer: &Arc<Framebuffer<F>>, clear_values: C) -> PrimaryCommandBufferBuilderSecondaryDraw where F: RenderPass + RenderPassDesc + RenderPassClearValues<C> + 'static, R: RenderPass + RenderPassDesc + 'static
Start drawing on a framebuffer. This function returns an object that can be used to submit secondary graphics command buffers that will operate on the first subpass of the renderpass.
Panic
- Panicks if the framebuffer is not compatible with the renderpass.
fn build_raw(self) -> Result<PrimaryCommandBuffer, OomError>
See the docs of build().
fn build(self) -> Arc<PrimaryCommandBuffer>
Finish recording commands and build the command buffer.
Panic
- Panicks if the device or host ran out of memory.