Struct vulkano::command_buffer::synced::SyncCommandBufferBuilder
source · [−]pub struct SyncCommandBufferBuilder { /* private fields */ }
Expand description
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
sourceimpl SyncCommandBufferBuilder
impl SyncCommandBufferBuilder
sourcepub unsafe fn begin_query(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
flags: QueryControlFlags
)
pub unsafe fn begin_query(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
flags: QueryControlFlags
)
Calls vkCmdBeginQuery
on the builder.
sourcepub unsafe fn begin_render_pass(
&mut self,
render_pass_begin_info: RenderPassBeginInfo,
subpass_contents: SubpassContents
) -> Result<(), SyncCommandBufferBuilderError>
pub unsafe fn begin_render_pass(
&mut self,
render_pass_begin_info: RenderPassBeginInfo,
subpass_contents: SubpassContents
) -> Result<(), SyncCommandBufferBuilderError>
Calls vkBeginRenderPass
on the builder.
sourcepub fn bind_descriptor_sets(
&mut self
) -> SyncCommandBufferBuilderBindDescriptorSets<'_>
pub fn bind_descriptor_sets(
&mut self
) -> SyncCommandBufferBuilderBindDescriptorSets<'_>
Starts the process of binding descriptor sets. Returns an intermediate struct which can be used to add the sets.
sourcepub unsafe fn bind_index_buffer(
&mut self,
buffer: Arc<dyn BufferAccess>,
index_ty: IndexType
)
pub unsafe fn bind_index_buffer(
&mut self,
buffer: Arc<dyn BufferAccess>,
index_ty: IndexType
)
Calls vkCmdBindIndexBuffer
on the builder.
sourcepub unsafe fn bind_pipeline_compute(&mut self, pipeline: Arc<ComputePipeline>)
pub unsafe fn bind_pipeline_compute(&mut self, pipeline: Arc<ComputePipeline>)
Calls vkCmdBindPipeline
on the builder with a compute pipeline.
sourcepub unsafe fn bind_pipeline_graphics(&mut self, pipeline: Arc<GraphicsPipeline>)
pub unsafe fn bind_pipeline_graphics(&mut self, pipeline: Arc<GraphicsPipeline>)
Calls vkCmdBindPipeline
on the builder with a graphics pipeline.
sourcepub fn bind_vertex_buffers(
&mut self
) -> SyncCommandBufferBuilderBindVertexBuffer<'_>
pub fn bind_vertex_buffers(
&mut self
) -> SyncCommandBufferBuilderBindVertexBuffer<'_>
Starts the process of binding vertex buffers. Returns an intermediate struct which can be used to add the buffers.
sourcepub unsafe fn copy_image<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderImageCopy> + Send + Sync + 'static,
pub unsafe fn copy_image<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderImageCopy> + Send + Sync + 'static,
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.
sourcepub unsafe fn blit_image<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R,
filter: Filter
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderImageBlit> + Send + Sync + 'static,
pub unsafe fn blit_image<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R,
filter: Filter
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderImageBlit> + Send + Sync + 'static,
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.
sourcepub unsafe fn clear_attachments<A, R>(&mut self, attachments: A, rects: R) where
A: IntoIterator<Item = ClearAttachment>,
R: IntoIterator<Item = ClearRect>,
pub unsafe fn clear_attachments<A, R>(&mut self, attachments: A, rects: R) where
A: IntoIterator<Item = ClearAttachment>,
R: IntoIterator<Item = ClearRect>,
Calls vkCmdClearAttachments
on the builder.
Does nothing if the list of attachments or the list of rects is empty, as it would be a no-op and isn’t a valid usage of the command anyway.
sourcepub unsafe fn clear_color_image<R>(
&mut self,
image: Arc<dyn ImageAccess>,
layout: ImageLayout,
color: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
pub unsafe fn clear_color_image<R>(
&mut self,
image: Arc<dyn ImageAccess>,
layout: ImageLayout,
color: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderColorImageClear> + Send + Sync + 'static,
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.
sourcepub unsafe fn clear_depth_stencil_image<R>(
&mut self,
image: Arc<dyn ImageAccess>,
layout: ImageLayout,
clear_value: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderDepthStencilImageClear> + Send + Sync + 'static,
pub unsafe fn clear_depth_stencil_image<R>(
&mut self,
image: Arc<dyn ImageAccess>,
layout: ImageLayout,
clear_value: ClearValue,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderDepthStencilImageClear> + Send + Sync + 'static,
Calls vkCmdClearDepthStencilImage
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.
sourcepub unsafe fn copy_buffer<R>(
&mut self,
source: Arc<dyn BufferAccess>,
destination: Arc<dyn BufferAccess>,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = (DeviceSize, DeviceSize, DeviceSize)> + Send + Sync + 'static,
pub unsafe fn copy_buffer<R>(
&mut self,
source: Arc<dyn BufferAccess>,
destination: Arc<dyn BufferAccess>,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = (DeviceSize, DeviceSize, DeviceSize)> + Send + Sync + 'static,
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.
sourcepub unsafe fn copy_buffer_to_image<R>(
&mut self,
source: Arc<dyn BufferAccess>,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
pub unsafe fn copy_buffer_to_image<R>(
&mut self,
source: Arc<dyn BufferAccess>,
destination: Arc<dyn ImageAccess>,
destination_layout: ImageLayout,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
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.
sourcepub unsafe fn copy_image_to_buffer<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn BufferAccess>,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
pub unsafe fn copy_image_to_buffer<R>(
&mut self,
source: Arc<dyn ImageAccess>,
source_layout: ImageLayout,
destination: Arc<dyn BufferAccess>,
regions: R
) -> Result<(), SyncCommandBufferBuilderError> where
R: IntoIterator<Item = UnsafeCommandBufferBuilderBufferImageCopy> + Send + Sync + 'static,
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.
sourcepub unsafe fn copy_query_pool_results<D, T>(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>,
destination: Arc<D>,
stride: DeviceSize,
flags: QueryResultFlags
) -> Result<(), SyncCommandBufferBuilderError> where
D: TypedBufferAccess<Content = [T]> + 'static,
T: QueryResultElement,
pub unsafe fn copy_query_pool_results<D, T>(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>,
destination: Arc<D>,
stride: DeviceSize,
flags: QueryResultFlags
) -> Result<(), SyncCommandBufferBuilderError> where
D: TypedBufferAccess<Content = [T]> + 'static,
T: QueryResultElement,
Calls vkCmdCopyQueryPoolResults
on the builder.
Safety
stride
must be at least the number of bytes that will be written by each query.
sourcepub unsafe fn debug_marker_begin(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
pub unsafe fn debug_marker_begin(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
Calls vkCmdBeginDebugUtilsLabelEXT
on the builder.
Safety
The command pool that this command buffer was allocated from must support graphics or compute operations
sourcepub unsafe fn debug_marker_end(&mut self)
pub unsafe fn debug_marker_end(&mut self)
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.
sourcepub unsafe fn debug_marker_insert(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
pub unsafe fn debug_marker_insert(
&mut self,
name: &'static CStr,
color: [f32; 4]
)
Calls vkCmdInsertDebugUtilsLabelEXT
on the builder.
Safety
The command pool that this command buffer was allocated from must support graphics or compute operations
sourcepub unsafe fn dispatch_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>
) -> Result<(), SyncCommandBufferBuilderError>
pub unsafe fn dispatch_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>
) -> Result<(), SyncCommandBufferBuilderError>
Calls vkCmdDispatchIndirect
on the builder.
sourcepub unsafe fn draw(
&mut self,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32
)
pub unsafe fn draw(
&mut self,
vertex_count: u32,
instance_count: u32,
first_vertex: u32,
first_instance: u32
)
Calls vkCmdDraw
on the builder.
sourcepub unsafe fn draw_indexed(
&mut self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32
)
pub unsafe fn draw_indexed(
&mut self,
index_count: u32,
instance_count: u32,
first_index: u32,
vertex_offset: i32,
first_instance: u32
)
Calls vkCmdDrawIndexed
on the builder.
sourcepub unsafe fn draw_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError>
pub unsafe fn draw_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError>
Calls vkCmdDrawIndirect
on the builder.
sourcepub unsafe fn draw_indexed_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError>
pub unsafe fn draw_indexed_indirect(
&mut self,
indirect_buffer: Arc<dyn BufferAccess>,
draw_count: u32,
stride: u32
) -> Result<(), SyncCommandBufferBuilderError>
Calls vkCmdDrawIndexedIndirect
on the builder.
sourcepub unsafe fn end_query(&mut self, query_pool: Arc<QueryPool>, query: u32)
pub unsafe fn end_query(&mut self, query_pool: Arc<QueryPool>, query: u32)
Calls vkCmdEndQuery
on the builder.
sourcepub unsafe fn end_render_pass(&mut self)
pub unsafe fn end_render_pass(&mut self)
Calls vkCmdEndRenderPass
on the builder.
sourcepub unsafe fn execute_commands(
&mut self
) -> SyncCommandBufferBuilderExecuteCommands<'_>
pub unsafe fn execute_commands(
&mut self
) -> SyncCommandBufferBuilderExecuteCommands<'_>
Starts the process of executing secondary command buffers. Returns an intermediate struct which can be used to add the command buffers.
sourcepub unsafe fn fill_buffer(&mut self, buffer: Arc<dyn BufferAccess>, data: u32)
pub unsafe fn fill_buffer(&mut self, buffer: Arc<dyn BufferAccess>, data: u32)
Calls vkCmdFillBuffer
on the builder.
sourcepub unsafe fn next_subpass(&mut self, subpass_contents: SubpassContents)
pub unsafe fn next_subpass(&mut self, subpass_contents: SubpassContents)
Calls vkCmdNextSubpass
on the builder.
sourcepub unsafe fn push_constants<D>(
&mut self,
pipeline_layout: Arc<PipelineLayout>,
stages: ShaderStages,
offset: u32,
size: u32,
data: &D
) where
D: ?Sized + Send + Sync + 'static,
pub unsafe fn push_constants<D>(
&mut self,
pipeline_layout: Arc<PipelineLayout>,
stages: ShaderStages,
offset: u32,
size: u32,
data: &D
) where
D: ?Sized + Send + Sync + 'static,
Calls vkCmdPushConstants
on the builder.
sourcepub unsafe fn push_descriptor_set(
&mut self,
pipeline_bind_point: PipelineBindPoint,
pipeline_layout: Arc<PipelineLayout>,
set_num: u32,
descriptor_writes: impl IntoIterator<Item = WriteDescriptorSet>
)
pub unsafe fn push_descriptor_set(
&mut self,
pipeline_bind_point: PipelineBindPoint,
pipeline_layout: Arc<PipelineLayout>,
set_num: u32,
descriptor_writes: impl IntoIterator<Item = WriteDescriptorSet>
)
Calls vkCmdPushDescriptorSetKHR
on the builder.
sourcepub unsafe fn reset_event(&mut self, event: Arc<Event>, stages: PipelineStages)
pub unsafe fn reset_event(&mut self, event: Arc<Event>, stages: PipelineStages)
Calls vkCmdResetEvent
on the builder.
sourcepub unsafe fn reset_query_pool(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>
)
pub unsafe fn reset_query_pool(
&mut self,
query_pool: Arc<QueryPool>,
queries: Range<u32>
)
Calls vkCmdResetQueryPool
on the builder.
sourcepub unsafe fn set_blend_constants(&mut self, constants: [f32; 4])
pub unsafe fn set_blend_constants(&mut self, constants: [f32; 4])
Calls vkCmdSetBlendConstants
on the builder.
sourcepub unsafe fn set_color_write_enable<I>(&mut self, enables: I) where
I: IntoIterator<Item = bool>,
pub unsafe fn set_color_write_enable<I>(&mut self, enables: I) where
I: IntoIterator<Item = bool>,
Calls vkCmdSetColorWriteEnableEXT
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn set_cull_mode(&mut self, cull_mode: CullMode)
pub unsafe fn set_cull_mode(&mut self, cull_mode: CullMode)
Calls vkCmdSetCullModeEXT
on the builder.
sourcepub unsafe fn set_depth_bias(
&mut self,
constant_factor: f32,
clamp: f32,
slope_factor: f32
)
pub unsafe fn set_depth_bias(
&mut self,
constant_factor: f32,
clamp: f32,
slope_factor: f32
)
Calls vkCmdSetDepthBias
on the builder.
sourcepub unsafe fn set_depth_bias_enable(&mut self, enable: bool)
pub unsafe fn set_depth_bias_enable(&mut self, enable: bool)
Calls vkCmdSetDepthBiasEnableEXT
on the builder.
sourcepub unsafe fn set_depth_bounds(&mut self, min: f32, max: f32)
pub unsafe fn set_depth_bounds(&mut self, min: f32, max: f32)
Calls vkCmdSetDepthBounds
on the builder.
sourcepub unsafe fn set_depth_bounds_test_enable(&mut self, enable: bool)
pub unsafe fn set_depth_bounds_test_enable(&mut self, enable: bool)
Calls vkCmdSetDepthBoundsTestEnableEXT
on the builder.
sourcepub unsafe fn set_depth_compare_op(&mut self, compare_op: CompareOp)
pub unsafe fn set_depth_compare_op(&mut self, compare_op: CompareOp)
Calls vkCmdSetDepthCompareOpEXT
on the builder.
sourcepub unsafe fn set_depth_test_enable(&mut self, enable: bool)
pub unsafe fn set_depth_test_enable(&mut self, enable: bool)
Calls vkCmdSetDepthTestEnableEXT
on the builder.
sourcepub unsafe fn set_depth_write_enable(&mut self, enable: bool)
pub unsafe fn set_depth_write_enable(&mut self, enable: bool)
Calls vkCmdSetDepthWriteEnableEXT
on the builder.
sourcepub unsafe fn set_discard_rectangle<I>(
&mut self,
first_rectangle: u32,
rectangles: I
) where
I: IntoIterator<Item = Scissor>,
pub unsafe fn set_discard_rectangle<I>(
&mut self,
first_rectangle: u32,
rectangles: I
) where
I: IntoIterator<Item = Scissor>,
Calls vkCmdSetDiscardRectangle
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn set_event(&mut self, event: Arc<Event>, stages: PipelineStages)
pub unsafe fn set_event(&mut self, event: Arc<Event>, stages: PipelineStages)
Calls vkCmdSetEvent
on the builder.
sourcepub unsafe fn set_front_face(&mut self, face: FrontFace)
pub unsafe fn set_front_face(&mut self, face: FrontFace)
Calls vkCmdSetFrontFaceEXT
on the builder.
sourcepub unsafe fn set_line_stipple(&mut self, factor: u32, pattern: u16)
pub unsafe fn set_line_stipple(&mut self, factor: u32, pattern: u16)
Calls vkCmdSetLineStippleEXT
on the builder.
sourcepub unsafe fn set_line_width(&mut self, line_width: f32)
pub unsafe fn set_line_width(&mut self, line_width: f32)
Calls vkCmdSetLineWidth
on the builder.
sourcepub unsafe fn set_logic_op(&mut self, logic_op: LogicOp)
pub unsafe fn set_logic_op(&mut self, logic_op: LogicOp)
Calls vkCmdSetLogicOpEXT
on the builder.
sourcepub unsafe fn set_patch_control_points(&mut self, num: u32)
pub unsafe fn set_patch_control_points(&mut self, num: u32)
Calls vkCmdSetPatchControlPointsEXT
on the builder.
sourcepub unsafe fn set_primitive_restart_enable(&mut self, enable: bool)
pub unsafe fn set_primitive_restart_enable(&mut self, enable: bool)
Calls vkCmdSetPrimitiveRestartEnableEXT
on the builder.
sourcepub unsafe fn set_primitive_topology(&mut self, topology: PrimitiveTopology)
pub unsafe fn set_primitive_topology(&mut self, topology: PrimitiveTopology)
Calls vkCmdSetPrimitiveTopologyEXT
on the builder.
sourcepub unsafe fn set_rasterizer_discard_enable(&mut self, enable: bool)
pub unsafe fn set_rasterizer_discard_enable(&mut self, enable: bool)
Calls vkCmdSetRasterizerDiscardEnableEXT
on the builder.
sourcepub unsafe fn set_stencil_compare_mask(
&mut self,
faces: StencilFaces,
compare_mask: u32
)
pub unsafe fn set_stencil_compare_mask(
&mut self,
faces: StencilFaces,
compare_mask: u32
)
Calls vkCmdSetStencilCompareMask
on the builder.
sourcepub unsafe fn set_stencil_op(
&mut self,
faces: StencilFaces,
fail_op: StencilOp,
pass_op: StencilOp,
depth_fail_op: StencilOp,
compare_op: CompareOp
)
pub unsafe fn set_stencil_op(
&mut self,
faces: StencilFaces,
fail_op: StencilOp,
pass_op: StencilOp,
depth_fail_op: StencilOp,
compare_op: CompareOp
)
Calls vkCmdSetStencilOpEXT
on the builder.
sourcepub unsafe fn set_stencil_reference(
&mut self,
faces: StencilFaces,
reference: u32
)
pub unsafe fn set_stencil_reference(
&mut self,
faces: StencilFaces,
reference: u32
)
Calls vkCmdSetStencilReference
on the builder.
sourcepub unsafe fn set_stencil_test_enable(&mut self, enable: bool)
pub unsafe fn set_stencil_test_enable(&mut self, enable: bool)
Calls vkCmdSetStencilTestEnableEXT
on the builder.
sourcepub unsafe fn set_stencil_write_mask(
&mut self,
faces: StencilFaces,
write_mask: u32
)
pub unsafe fn set_stencil_write_mask(
&mut self,
faces: StencilFaces,
write_mask: u32
)
Calls vkCmdSetStencilWriteMask
on the builder.
sourcepub unsafe fn set_scissor<I>(&mut self, first_scissor: u32, scissors: I) where
I: IntoIterator<Item = Scissor>,
pub unsafe fn set_scissor<I>(&mut self, first_scissor: u32, scissors: I) where
I: IntoIterator<Item = Scissor>,
Calls vkCmdSetScissor
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn set_scissor_with_count<I>(&mut self, scissors: I) where
I: IntoIterator<Item = Scissor>,
pub unsafe fn set_scissor_with_count<I>(&mut self, scissors: I) where
I: IntoIterator<Item = Scissor>,
Calls vkCmdSetScissorWithCountEXT
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn set_viewport<I>(&mut self, first_viewport: u32, viewports: I) where
I: IntoIterator<Item = Viewport>,
pub unsafe fn set_viewport<I>(&mut self, first_viewport: u32, viewports: I) where
I: IntoIterator<Item = Viewport>,
Calls vkCmdSetViewport
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn set_viewport_with_count<I>(&mut self, viewports: I) where
I: IntoIterator<Item = Viewport>,
pub unsafe fn set_viewport_with_count<I>(&mut self, viewports: I) where
I: IntoIterator<Item = Viewport>,
Calls vkCmdSetViewportWithCountEXT
on the builder.
If the list is empty then the command is automatically ignored.
sourcepub unsafe fn update_buffer<D, Dd>(
&mut self,
buffer: Arc<dyn BufferAccess>,
data: Dd
) where
D: BufferContents + ?Sized,
Dd: SafeDeref<Target = D> + Send + Sync + 'static,
pub unsafe fn update_buffer<D, Dd>(
&mut self,
buffer: Arc<dyn BufferAccess>,
data: Dd
) where
D: BufferContents + ?Sized,
Dd: SafeDeref<Target = D> + Send + Sync + 'static,
Calls vkCmdUpdateBuffer
on the builder.
sourcepub unsafe fn write_timestamp(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
stage: PipelineStage
)
pub unsafe fn write_timestamp(
&mut self,
query_pool: Arc<QueryPool>,
query: u32,
stage: PipelineStage
)
Calls vkCmdWriteTimestamp
on the builder.
sourceimpl SyncCommandBufferBuilder
impl SyncCommandBufferBuilder
sourcepub unsafe fn new(
pool_alloc: &UnsafeCommandPoolAlloc,
begin_info: CommandBufferBeginInfo
) -> Result<SyncCommandBufferBuilder, OomError>
pub unsafe fn new(
pool_alloc: &UnsafeCommandPoolAlloc,
begin_info: CommandBufferBeginInfo
) -> Result<SyncCommandBufferBuilder, OomError>
Builds a new SyncCommandBufferBuilder
. The parameters are the same as the
UnsafeCommandBufferBuilder::new
function.
Safety
See UnsafeCommandBufferBuilder::new()
.
sourcepub unsafe fn from_unsafe_cmd(
cmd: UnsafeCommandBufferBuilder,
is_secondary: bool,
inside_render_pass: bool
) -> SyncCommandBufferBuilder
pub unsafe fn from_unsafe_cmd(
cmd: UnsafeCommandBufferBuilder,
is_secondary: bool,
inside_render_pass: bool
) -> SyncCommandBufferBuilder
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.
sourcepub fn state(&self) -> CommandBufferState<'_>
pub fn state(&self) -> CommandBufferState<'_>
Returns the binding/setting state.
sourcepub fn reset_state(&mut self)
pub fn reset_state(&mut self)
Resets the binding/setting state.
This must be called after any command that changes the state in an undefined way, e.g. executing a secondary command buffer.
sourcepub fn build(self) -> Result<SyncCommandBuffer, OomError>
pub fn build(self) -> Result<SyncCommandBuffer, OomError>
Builds the command buffer and turns it into a SyncCommandBuffer
.
Trait Implementations
sourceimpl Debug for SyncCommandBufferBuilder
impl Debug for SyncCommandBufferBuilder
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more