Struct vulkano::command_buffer::synced::SyncCommandBufferBuilder [−][src]
pub struct SyncCommandBufferBuilder { /* fields omitted */ }
Wrapper around UnsafeCommandBufferBuilder
that handles synchronization for you.
Each method of the UnsafeCommandBufferBuilder
has an equivalent in this wrapper, except
for pipeline_layout
which is automatically handled. This wrapper automatically builds
pipeline barriers, keeps used resources alive and implements the CommandBuffer
trait.
Since the implementation needs to cache commands in a Vec
, most methods have additional
Send + Sync + 'static
trait requirements on their generics.
If this builder finds out that a command isn’t valid because of synchronization reasons (eg. trying to copy from a buffer to an image which share the same memory), then an error is returned. Note that all methods are still unsafe, because this builder doesn’t check the validity of the commands except for synchronization purposes. The builder may panic if you pass invalid commands.
Implementations
impl SyncCommandBufferBuilder
[src]
impl SyncCommandBufferBuilder
[src]pub unsafe fn new<F>(
pool_alloc: &UnsafeCommandPoolAlloc,
level: CommandBufferLevel<F>,
usage: CommandBufferUsage
) -> Result<SyncCommandBufferBuilder, OomError> where
F: FramebufferAbstract,
[src]
pub unsafe fn new<F>(
pool_alloc: &UnsafeCommandPoolAlloc,
level: CommandBufferLevel<F>,
usage: CommandBufferUsage
) -> Result<SyncCommandBufferBuilder, OomError> where
F: FramebufferAbstract,
[src]Builds a new SyncCommandBufferBuilder
. The parameters are the same as the
UnsafeCommandBufferBuilder::new
function.
Safety
See UnsafeCommandBufferBuilder::new()
.
pub unsafe fn from_unsafe_cmd(
cmd: UnsafeCommandBufferBuilder,
is_secondary: bool,
inside_render_pass: bool
) -> SyncCommandBufferBuilder
[src]
pub unsafe fn from_unsafe_cmd(
cmd: UnsafeCommandBufferBuilder,
is_secondary: bool,
inside_render_pass: bool
) -> SyncCommandBufferBuilder
[src]Builds a SyncCommandBufferBuilder
from an existing UnsafeCommandBufferBuilder
.
Safety
See UnsafeCommandBufferBuilder::new()
.
In addition to this, the UnsafeCommandBufferBuilder
should be empty. If it isn’t, then
you must take into account the fact that the SyncCommandBufferBuilder
won’t be aware of
any existing resource usage.
pub fn build(self) -> Result<SyncCommandBuffer, OomError>
[src]
pub fn build(self) -> Result<SyncCommandBuffer, OomError>
[src]Builds the command buffer and turns it into a SyncCommandBuffer
.
impl SyncCommandBufferBuilder
[src]
impl SyncCommandBufferBuilder
[src]pub unsafe fn begin_query(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
flags: QueryControlFlags
)
[src]
pub unsafe fn begin_query(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
flags: QueryControlFlags
)
[src]Calls vkCmdBeginQuery
on the builder.
pub unsafe fn begin_render_pass<F, I>(
&mut self,
framebuffer: F,
subpass_contents: SubpassContents,
clear_values: I
) -> Result<(), SyncCommandBufferBuilderError> where
F: FramebufferAbstract + Send + Sync + 'static,
I: Iterator<Item = ClearValue> + Send + Sync + 'static,
[src]
pub unsafe fn begin_render_pass<F, I>(
&mut self,
framebuffer: F,
subpass_contents: SubpassContents,
clear_values: I
) -> Result<(), SyncCommandBufferBuilderError> where
F: FramebufferAbstract + Send + Sync + 'static,
I: Iterator<Item = ClearValue> + Send + Sync + 'static,
[src]Calls vkBeginRenderPass
on the builder.
pub unsafe fn bind_index_buffer<B>(
&mut self,
buffer: B,
index_ty: IndexType
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]
pub unsafe fn bind_index_buffer<B>(
&mut self,
buffer: B,
index_ty: IndexType
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]Calls vkCmdBindIndexBuffer
on the builder.
pub unsafe fn bind_pipeline_graphics<Gp>(&mut self, pipeline: Gp) where
Gp: GraphicsPipelineAbstract + Send + Sync + 'static,
[src]
pub unsafe fn bind_pipeline_graphics<Gp>(&mut self, pipeline: Gp) where
Gp: GraphicsPipelineAbstract + Send + Sync + 'static,
[src]Calls vkCmdBindPipeline
on the builder with a graphics pipeline.
pub unsafe fn bind_pipeline_compute<Cp>(&mut self, pipeline: Cp) where
Cp: ComputePipelineAbstract + Send + Sync + 'static,
[src]
pub unsafe fn bind_pipeline_compute<Cp>(&mut self, pipeline: Cp) where
Cp: ComputePipelineAbstract + Send + Sync + 'static,
[src]Calls vkCmdBindPipeline
on the builder with a compute pipeline.
pub fn bind_descriptor_sets(
&mut self
) -> SyncCommandBufferBuilderBindDescriptorSets<'_>
[src]
pub fn bind_descriptor_sets(
&mut self
) -> SyncCommandBufferBuilderBindDescriptorSets<'_>
[src]Starts the process of binding descriptor sets. Returns an intermediate struct which can be used to add the sets.
pub fn bind_vertex_buffers(
&mut self
) -> SyncCommandBufferBuilderBindVertexBuffer<'_>
[src]
pub fn bind_vertex_buffers(
&mut self
) -> SyncCommandBufferBuilderBindVertexBuffer<'_>
[src]Starts the process of binding vertex buffers. Returns an intermediate struct which can be used to add the buffers.
pub unsafe fn copy_image<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderImageCopy> + Send + Sync + 'static,
[src]
pub unsafe fn copy_image<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderImageCopy> + Send + Sync + 'static,
[src]Calls vkCmdCopyImage
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn blit_image<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
destination_layout: ImageLayout,
regions: R,
filter: Filter
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderImageBlit> + Send + Sync + 'static,
[src]
pub unsafe fn blit_image<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
destination_layout: ImageLayout,
regions: R,
filter: Filter
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderImageBlit> + Send + Sync + 'static,
[src]Calls vkCmdBlitImage
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn clear_color_image<I, R>(
&mut self,
image: I,
layout: ImageLayout,
color: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
I: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
[src]
pub unsafe fn clear_color_image<I, R>(
&mut self,
image: I,
layout: ImageLayout,
color: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
I: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
[src]Calls vkCmdClearColorImage
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn copy_buffer<S, D, R>(
&mut self,
source: S,
destination: D,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: BufferAccess + Send + Sync + 'static,
D: BufferAccess + Send + Sync + 'static,
R: Iterator<Item = (usize, usize, usize)> + Send + Sync + 'static,
[src]
pub unsafe fn copy_buffer<S, D, R>(
&mut self,
source: S,
destination: D,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: BufferAccess + Send + Sync + 'static,
D: BufferAccess + Send + Sync + 'static,
R: Iterator<Item = (usize, usize, usize)> + Send + Sync + 'static,
[src]Calls vkCmdCopyBuffer
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn copy_buffer_to_image<S, D, R>(
&mut self,
source: S,
destination: D,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: BufferAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
[src]
pub unsafe fn copy_buffer_to_image<S, D, R>(
&mut self,
source: S,
destination: D,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: BufferAccess + Send + Sync + 'static,
D: ImageAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
[src]Calls vkCmdCopyBufferToImage
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn copy_image_to_buffer<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: BufferAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
[src]
pub unsafe fn copy_image_to_buffer<S, D, R>(
&mut self,
source: S,
source_layout: ImageLayout,
destination: D,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
S: ImageAccess + Send + Sync + 'static,
D: BufferAccess + Send + Sync + 'static,
R: Iterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
[src]Calls vkCmdCopyImageToBuffer
on the builder.
Does nothing if the list of regions is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
pub unsafe fn copy_query_pool_results<D, T>(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>,
destination: D,
stride: usize,
flags: QueryResultFlags
) -> Result<(), SyncCommandBufferBuilderError> where
D: BufferAccess + TypedBufferAccess<Content = [T]> + Send + Sync + 'static,
T: QueryResultElement,
[src]
pub unsafe fn copy_query_pool_results<D, T>(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>,
destination: D,
stride: usize,
flags: QueryResultFlags
) -> Result<(), SyncCommandBufferBuilderError> where
D: BufferAccess + TypedBufferAccess<Content = [T]> + Send + Sync + 'static,
T: QueryResultElement,
[src]Calls vkCmdCopyQueryPoolResults
on the builder.
Safety
stride
must be at least the number of bytes that will be written by each query.
pub unsafe fn debug_marker_begin(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
[src]
pub unsafe fn debug_marker_begin(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
[src]Calls vkCmdBeginDebugUtilsLabelEXT
on the builder.
Safety
The command pool that this command buffer was allocated from must support graphics or compute operations
pub unsafe fn debug_marker_end(&mut self)
[src]
pub unsafe fn debug_marker_end(&mut self)
[src]Calls vkCmdEndDebugUtilsLabelEXT
on the builder.
Safety
- The command pool that this command buffer was allocated from must support graphics or compute operations
- There must be an outstanding
debug_marker_begin
command prior to thedebug_marker_end
on the queue.
pub unsafe fn debug_marker_insert(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
[src]
pub unsafe fn debug_marker_insert(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
[src]Calls vkCmdInsertDebugUtilsLabelEXT
on the builder.
Safety
The command pool that this command buffer was allocated from must support graphics or compute operations
pub unsafe fn dispatch_indirect<B>(
&mut self,
buffer: B
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]
pub unsafe fn dispatch_indirect<B>(
&mut self,
buffer: B
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]Calls vkCmdDispatchIndirect
on the builder.
pub unsafe fn draw(
&mut self,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32
)
[src]
pub unsafe fn draw(
&mut self,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32
)
[src]Calls vkCmdDraw
on the builder.
pub unsafe fn draw_indexed(
&mut self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32
)
[src]
pub unsafe fn draw_indexed(
&mut self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32
)
[src]Calls vkCmdDrawIndexed
on the builder.
pub unsafe fn draw_indirect<B>(
&mut self,
buffer: B,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]
pub unsafe fn draw_indirect<B>(
&mut self,
buffer: B,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]Calls vkCmdDrawIndirect
on the builder.
pub unsafe fn draw_indexed_indirect<B>(
&mut self,
buffer: B,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]
pub unsafe fn draw_indexed_indirect<B>(
&mut self,
buffer: B,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError> where
B: BufferAccess + Send + Sync + 'static,
[src]Calls vkCmdDrawIndexedIndirect
on the builder.
pub unsafe fn end_query(&mut self, query_pool: Arc<QueryPool>, query: u32)
[src]
pub unsafe fn end_query(&mut self, query_pool: Arc<QueryPool>, query: u32)
[src]Calls vkCmdEndQuery
on the builder.
pub unsafe fn end_render_pass(&mut self)
[src]
pub unsafe fn end_render_pass(&mut self)
[src]Calls vkCmdEndRenderPass
on the builder.
pub unsafe fn execute_commands(
&mut self
) -> SyncCommandBufferBuilderExecuteCommands<'_>
[src]
pub unsafe fn execute_commands(
&mut self
) -> SyncCommandBufferBuilderExecuteCommands<'_>
[src]Starts the process of executing secondary command buffers. Returns an intermediate struct which can be used to add the command buffers.
pub unsafe fn fill_buffer<B>(&mut self, buffer: B, data: u32) where
B: BufferAccess + Send + Sync + 'static,
[src]
pub unsafe fn fill_buffer<B>(&mut self, buffer: B, data: u32) where
B: BufferAccess + Send + Sync + 'static,
[src]Calls vkCmdFillBuffer
on the builder.
pub unsafe fn next_subpass(&mut self, subpass_contents: SubpassContents)
[src]
pub unsafe fn next_subpass(&mut self, subpass_contents: SubpassContents)
[src]Calls vkCmdNextSubpass
on the builder.
pub unsafe fn push_constants<Pl, D: ?Sized>(
&mut self,
pipeline_layout: Pl,
stages: ShaderStages,
offset: u32,
size: u32,
data: &D
) where
Pl: PipelineLayoutAbstract + Send + Sync + 'static,
D: Send + Sync + 'static,
[src]
pub unsafe fn push_constants<Pl, D: ?Sized>(
&mut self,
pipeline_layout: Pl,
stages: ShaderStages,
offset: u32,
size: u32,
data: &D
) where
Pl: PipelineLayoutAbstract + Send + Sync + 'static,
D: Send + Sync + 'static,
[src]Calls vkCmdPushConstants
on the builder.
pub unsafe fn reset_event(&mut self, event: Arc<Event>, stages: PipelineStages)
[src]
pub unsafe fn reset_event(&mut self, event: Arc<Event>, stages: PipelineStages)
[src]Calls vkCmdResetEvent
on the builder.
pub unsafe fn reset_query_pool(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>
)
[src]
pub unsafe fn reset_query_pool(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>
)
[src]Calls vkCmdResetQueryPool
on the builder.
pub unsafe fn set_blend_constants(&mut self, constants: [f32; 4])
[src]
pub unsafe fn set_blend_constants(&mut self, constants: [f32; 4])
[src]Calls vkCmdSetBlendConstants
on the builder.
pub unsafe fn set_depth_bias(
&mut self,
constant_factor: f32,
clamp: f32,
slope_factor: f32
)
[src]
pub unsafe fn set_depth_bias(
&mut self,
constant_factor: f32,
clamp: f32,
slope_factor: f32
)
[src]Calls vkCmdSetDepthBias
on the builder.
pub unsafe fn set_depth_bounds(&mut self, min: f32, max: f32)
[src]
pub unsafe fn set_depth_bounds(&mut self, min: f32, max: f32)
[src]Calls vkCmdSetDepthBounds
on the builder.
pub unsafe fn set_event(&mut self, event: Arc<Event>, stages: PipelineStages)
[src]
pub unsafe fn set_event(&mut self, event: Arc<Event>, stages: PipelineStages)
[src]Calls vkCmdSetEvent
on the builder.
pub unsafe fn set_line_width(&mut self, line_width: f32)
[src]
pub unsafe fn set_line_width(&mut self, line_width: f32)
[src]Calls vkCmdSetLineWidth
on the builder.
pub unsafe fn set_stencil_compare_mask(
&mut self,
compare_mask: DynamicStencilValue
)
[src]
pub unsafe fn set_stencil_compare_mask(
&mut self,
compare_mask: DynamicStencilValue
)
[src]Calls vkCmdSetStencilCompareMask
on the builder.
pub unsafe fn set_stencil_reference(&mut self, reference: DynamicStencilValue)
[src]
pub unsafe fn set_stencil_reference(&mut self, reference: DynamicStencilValue)
[src]Calls vkCmdSetStencilReference
on the builder.
pub unsafe fn set_stencil_write_mask(&mut self, write_mask: DynamicStencilValue)
[src]
pub unsafe fn set_stencil_write_mask(&mut self, write_mask: DynamicStencilValue)
[src]Calls vkCmdSetStencilWriteMask
on the builder.
pub unsafe fn set_scissor<I>(&mut self, first_scissor: u32, scissors: I) where
I: Iterator<Item = Scissor> + Send + Sync + 'static,
[src]
pub unsafe fn set_scissor<I>(&mut self, first_scissor: u32, scissors: I) where
I: Iterator<Item = Scissor> + Send + Sync + 'static,
[src]Calls vkCmdSetScissor
on the builder.
If the list is empty then the command is automatically ignored.
pub unsafe fn set_viewport<I>(&mut self, first_viewport: u32, viewports: I) where
I: Iterator<Item = Viewport> + Send + Sync + 'static,
[src]
pub unsafe fn set_viewport<I>(&mut self, first_viewport: u32, viewports: I) where
I: Iterator<Item = Viewport> + Send + Sync + 'static,
[src]Calls vkCmdSetViewport
on the builder.
If the list is empty then the command is automatically ignored.
pub unsafe fn update_buffer<B, D, Dd>(&mut self, buffer: B, data: Dd) where
B: BufferAccess + Send + Sync + 'static,
D: ?Sized,
Dd: SafeDeref<Target = D> + Send + Sync + 'static,
[src]
pub unsafe fn update_buffer<B, D, Dd>(&mut self, buffer: B, data: Dd) where
B: BufferAccess + Send + Sync + 'static,
D: ?Sized,
Dd: SafeDeref<Target = D> + Send + Sync + 'static,
[src]Calls vkCmdUpdateBuffer
on the builder.
pub unsafe fn write_timestamp(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
stage: PipelineStage
)
[src]
pub unsafe fn write_timestamp(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
stage: PipelineStage
)
[src]Calls vkCmdWriteTimestamp
on the builder.
Trait Implementations
impl Debug for SyncCommandBufferBuilder
[src]
impl Debug for SyncCommandBufferBuilder
[src]impl DeviceOwned for SyncCommandBufferBuilder
[src]
impl DeviceOwned for SyncCommandBufferBuilder
[src]Auto Trait Implementations
impl !RefUnwindSafe for SyncCommandBufferBuilder
impl !Send for SyncCommandBufferBuilder
impl !Sync for SyncCommandBufferBuilder
impl Unpin for SyncCommandBufferBuilder
impl UnwindSafe for SyncCommandBufferBuilder
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Content for T
[src]
impl<T> Content for T
[src]pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]
pub fn ref_from_ptr(*mut c_void, usize) -> Option<*mut T>
[src]Builds a pointer to this type from a raw pointer.
pub fn is_size_suitable(usize) -> bool
[src]
pub fn is_size_suitable(usize) -> bool
[src]Returns true if the size is suitable to store a type like this.
pub fn indiv_size() -> usize
[src]
pub fn indiv_size() -> usize
[src]Returns the size of an individual element.