Struct vulkano::command_buffer::sys::UnsafeCommandBufferBuilder
[−]
[src]
pub struct UnsafeCommandBufferBuilder<P> where P: CommandPool { /* fields omitted */ }
Methods
impl<P> UnsafeCommandBufferBuilder<P> where P: CommandPool
[src]
fn new<R, F>(pool: P, kind: Kind<R, F>, flags: Flags) -> Result<UnsafeCommandBufferBuilder<P>, OomError> where R: RenderPass, F: Framebuffer
Creates a new builder.
unsafe fn already_allocated<R, F>(pool: P, cmd: AllocatedCommandBuffer, kind: Kind<R, F>, flags: Flags) -> Result<UnsafeCommandBufferBuilder<P>, OomError> where R: RenderPass, F: Framebuffer
Creates a new command buffer builder from an already-allocated command buffer.
Safety
- The allocated command buffer must belong to the pool and must not be used anywhere else in the code for the duration of this command buffer.
fn build(self) -> Result<UnsafeCommandBuffer<P>, OomError>
Finishes building the command buffer.
fn pool(&self) -> &P
Returns the pool used to create this command buffer builder.
fn device(&self) -> &Arc<Device>
Returns the device this command buffer belongs to.
fn is_secondary(&self) -> bool
Returns true if this is a secondary command buffer.
unsafe fn clear_color_image<I>(&mut self, image: &UnsafeImage, general_layout: bool, color: ClearValue, ranges: I) where I: Iterator<Item=ImageSubresourcesRange>
Clears an image with a color format, from outside of a render pass.
If general_layout
is true, then the General
image layout is used. Otherwise the
TransferDstOptimal
layout is used.
Panic
- Panics if the image was not created with the same device as this command buffer.
- Panics if the clear values is not a color value.
Safety
- The image must be kept alive and must be properly synchronized while this command buffer runs.
- The ranges must be in range of the image.
- The image must have a non-compressed color format.
- The clear value must match the format of the image.
- The queue family must support graphics or compute operations.
- The image must have been created with the "transfer_dest" usage.
- Must be called outside of a render pass.
unsafe fn clear_depth_stencil_image<I>(&mut self, image: &UnsafeImage, general_layout: bool, color: ClearValue, ranges: I) where I: Iterator<Item=ImageSubresourcesRange>
Clears an image with a depth, stencil or depth-stencil format, from outside of a render pass.
If the ClearValue
is a depth value, then only the depth component will be cleared. Same
for stencil. If it contains a depth-stencil value, then they will both be cleared.
If general_layout
is true, then the General
image layout is used. Otherwise the
TransferDstOptimal
layout is used.
Panic
- Panics if the image was not created with the same device as this command buffer.
- Panics if the mipmap levels range or the array layers range is invalid, ie. if the end is inferior to the start.
- Panics if the clear values is not a depth, stencil or depth-stencil value.
Safety
- The image must be kept alive and must be properly synchronized while this command buffer runs.
- The ranges must be in range of the image.
- The image must have a depth, stencil or depth-stencil format.
- The clear value must match the format of the image.
- The queue family must support graphics operations.
- The image must have been created with the "transfer_dest" usage.
- Must be called outside of a render pass.
unsafe fn clear_attachments<Ia, Ir>(&mut self, attachments: Ia, rects: Ir) where Ia: Iterator<Item=(u32, ClearValue)>, Ir: Iterator<Item=[(u32, u32); 3]>
Clears attachments of the current render pass.
You must pass a list of attachment ids and clear values, and a list of rectangles. Each
rectangle of each attachment will be cleared. The rectangle's format is
[(x, width), (y, height), (array_layer, num_array_layers)]
.
No memory barriers are needed between this function and preceding or subsequent draw or attachment clear commands in the same subpass.
Panic
- Panics if one of the clear values is
None
.
Safety
- The attachments ids must be valid, and the clear value must match the format of the attachments.
- Must be called from within a render pass.
- The rects must be in range of the framebuffer.
unsafe fn fill_buffer(&mut self, buffer: &UnsafeBuffer, offset: usize, size: usize, data: u32)
Fills a buffer by repeating a 32 bits data.
This is similar to the memset
function in C/C++.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
Safety
- The buffer must be kept alive and must be properly synchronized while this command buffer runs.
- The queue family must support graphics or compute operations.
- Type safety is not checked.
- The offset must be a multiple of four.
- The size must be a multiple of four, or must point to the end of the buffer.
- The buffer must have been created with the "transfer_dest" usage.
- Must be called outside of a render pass.
unsafe fn update_buffer<D: ?Sized>(&mut self, buffer: &UnsafeBuffer, offset: usize, size: usize, data: &D) where D: Copy + 'static
Fills a buffer with some data.
The actual size that is copied is the minimum between the size of the slice and the size of the data.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
Safety
- The buffer must be kept alive and must be properly synchronized while this command buffer runs.
- Type safety is not checked.
- The offset and size must be multiples of four.
- The size must be less than or equal to 65536 bytes (ie. 64kB).
- The buffer must have been created with the "transfer_dest" usage.
- Must be called outside of a render pass.
unsafe fn copy_buffer<I>(&mut self, src: &UnsafeBuffer, dest: &UnsafeBuffer, regions: I) where I: IntoIterator<Item=BufferCopyRegion>
Copies data from a source buffer to a destination buffer.
This is similar to the memcpy
function in C/C++.
Automatically filters out empty regions.
Panic
- Panics if one of the buffers was not created with the same device as this command buffer.
Safety
- The buffers must be kept alive and must be properly synchronized while this command buffer runs.
- Type safety is not checked.
- The source buffer must have been created with the "transfer_src" usage.
- The destination buffer must have been created with the "transfer_dest" usage.
- Must be called outside of a render pass.
- The offsets and size of the regions must be in range.
unsafe fn execute_commands<'sec, I, SecP: 'sec>(&mut self, command_buffers: I) where I: IntoIterator<Item=&'sec UnsafeCommandBuffer<SecP>>, SecP: CommandPool
Executes secondary command buffers..
fn pipeline_barrier(&mut self, barrier: PipelineBarrierBuilder)
Adds a pipeline barrier to the command buffer.
This function itself is not unsafe, but creating a pipeline barrier builder is.
unsafe fn begin_render_pass<I, F>(&mut self, render_pass: &UnsafeRenderPass, framebuffer: &F, clear_values: I, rect: [Range<u32>; 2], secondary: bool) where I: Iterator<Item=ClearValue>, F: Framebuffer
Enters a render pass.
Any clear value that is equal to None
is replaced with a dummy value. It is expected that
None
is passed only for attachments that are not cleared.
Panic
- Panics if the render pass or framebuffer was not created with the same device as this command buffer.
- Panics if one of the ranges is invalid.
Safety
- Must be called outside of a render pass.
- The queue family must support graphics operations.
- The render pass and the framebuffer must be kept alive.
- The render pass and the framebuffer must be compatible.
- The clear values must be valid for the attachments.
unsafe fn next_subpass(&mut self, secondary: bool)
Goes to the next subpass of the render pass.
Safety
- Must be called inside of a render pass.
- Must not be at the last subpass of the render pass.
unsafe fn end_render_pass(&mut self)
Ends the current render pass.
Safety
- Must be called inside of a render pass.
- Must be at the last subpass of the render pass.
unsafe fn bind_pipeline_graphics<V, L, R>(&mut self, pipeline: &GraphicsPipeline<V, L, R>)
Binds a graphics pipeline to the graphics pipeline bind point.
Safety
- The queue family must support graphics operations.
- If the variable multisample rate feature is not supported, the current subpass has no attachments, and this is not the first call to this function with a graphics pipeline after transitioning to the current subpass, then the sample count specified by this pipeline must match that set in the previous pipeline.
unsafe fn bind_pipeline_compute<L>(&mut self, pipeline: &ComputePipeline<L>)
Binds a compute pipeline to the compute pipeline bind point.
Safety
- The queue family must support compute operations.
unsafe fn draw(&mut self, vertex_count: u32, instance_count: u32, first_vertex: u32, first_instance: u32)
Calls vkCmdDraw
.
unsafe fn draw_indexed(&mut self, vertex_count: u32, instance_count: u32, first_index: u32, vertex_offset: i32, first_instance: u32)
Calls vkCmdDrawIndexed
.
unsafe fn draw_indirect(&mut self, buffer: &UnsafeBuffer, offset: usize, draw_count: u32, stride: u32)
Calls vkCmdDrawIndirect
.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
unsafe fn draw_indexed_indirect(&mut self, buffer: &UnsafeBuffer, offset: usize, draw_count: u32, stride: u32)
Calls vkCmdDrawIndexedIndirect
.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
unsafe fn dispatch(&mut self, x: u32, y: u32, z: u32)
Calls vkCmdDispatch
.
unsafe fn dispatch_indirect(&mut self, buffer: &UnsafeBuffer, offset: usize)
Calls vkCmdDispatchIndirect
.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
unsafe fn bind_vertex_buffers<'a, I>(&mut self, first_binding: u32, buffers: I) where I: IntoIterator<Item=(&'a UnsafeBuffer, usize)>
Calls vkCmdBindVertexBuffers
.
The iterator yields a list of buffers and offset of the first byte.
Panic
- Panics if one of the buffers was not created with the same device as this command buffer.
unsafe fn bind_index_buffer(&mut self, buffer: &UnsafeBuffer, offset: usize, index_ty: IndexType)
Calls vkCmdBindIndexBuffer
.
Panic
- Panics if the buffer was not created with the same device as this command buffer.
unsafe fn bind_descriptor_sets<'a, L, Ides, Idyn>(&mut self, graphics_bind_point: bool, layout: &L, first_set: u32, descriptor_sets: Ides, dynamic_offsets: Idyn) where L: PipelineLayout, Ides: IntoIterator<Item=&'a UnsafeDescriptorSet>, Idyn: IntoIterator<Item=u32>
Calls vkCmdBindDescriptorSets
.
Panic
- Panics if the layout or one of the sets were not created with the same device as this command buffer.
unsafe fn push_constants<L, D: ?Sized>(&mut self, layout: &L, stages: ShaderStages, offset: usize, data: &D) where L: PipelineLayout
Calls vkCmdPushConstants
.
Panic
- Panics if the layout was not created with the same device as this command buffer.
Trait Implementations
impl<P> VulkanObject for UnsafeCommandBufferBuilder<P> where P: CommandPool
[src]
type Object = CommandBuffer
The type of the object.
fn internal_object(&self) -> CommandBuffer
Returns a reference to the object.