logo
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

Calls vkCmdBeginQuery on the builder.

Calls vkBeginRenderPass on the builder.

Starts the process of binding descriptor sets. Returns an intermediate struct which can be used to add the sets.

Calls vkCmdBindIndexBuffer on the builder.

Calls vkCmdBindPipeline on the builder with a compute pipeline.

Calls vkCmdBindPipeline on the builder with a graphics pipeline.

Starts the process of binding vertex buffers. Returns an intermediate struct which can be used to add the buffers.

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.

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.

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.

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.

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.

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.

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.

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.

Calls vkCmdCopyQueryPoolResults on the builder.

Safety

stride must be at least the number of bytes that will be written by each query.

Calls vkCmdBeginDebugUtilsLabelEXT on the builder.

Safety

The command pool that this command buffer was allocated from must support graphics or compute operations

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 the debug_marker_end on the queue.

Calls vkCmdInsertDebugUtilsLabelEXT on the builder.

Safety

The command pool that this command buffer was allocated from must support graphics or compute operations

Calls vkCmdDispatch on the builder.

Calls vkCmdDispatchIndirect on the builder.

Calls vkCmdDraw on the builder.

Calls vkCmdDrawIndexed on the builder.

Calls vkCmdDrawIndirect on the builder.

Calls vkCmdDrawIndexedIndirect on the builder.

Calls vkCmdEndQuery on the builder.

Calls vkCmdEndRenderPass on the builder.

Starts the process of executing secondary command buffers. Returns an intermediate struct which can be used to add the command buffers.

Calls vkCmdFillBuffer on the builder.

Calls vkCmdNextSubpass on the builder.

Calls vkCmdPushConstants on the builder.

Calls vkCmdPushDescriptorSetKHR on the builder.

Calls vkCmdResetEvent on the builder.

Calls vkCmdResetQueryPool on the builder.

Calls vkCmdSetBlendConstants on the builder.

Calls vkCmdSetColorWriteEnableEXT on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdSetCullModeEXT on the builder.

Calls vkCmdSetDepthBias on the builder.

Calls vkCmdSetDepthBiasEnableEXT on the builder.

Calls vkCmdSetDepthBounds on the builder.

Calls vkCmdSetDepthBoundsTestEnableEXT on the builder.

Calls vkCmdSetDepthCompareOpEXT on the builder.

Calls vkCmdSetDepthTestEnableEXT on the builder.

Calls vkCmdSetDepthWriteEnableEXT on the builder.

Calls vkCmdSetDiscardRectangle on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdSetEvent on the builder.

Calls vkCmdSetFrontFaceEXT on the builder.

Calls vkCmdSetLineStippleEXT on the builder.

Calls vkCmdSetLineWidth on the builder.

Calls vkCmdSetLogicOpEXT on the builder.

Calls vkCmdSetPatchControlPointsEXT on the builder.

Calls vkCmdSetPrimitiveRestartEnableEXT on the builder.

Calls vkCmdSetPrimitiveTopologyEXT on the builder.

Calls vkCmdSetRasterizerDiscardEnableEXT on the builder.

Calls vkCmdSetStencilCompareMask on the builder.

Calls vkCmdSetStencilOpEXT on the builder.

Calls vkCmdSetStencilReference on the builder.

Calls vkCmdSetStencilTestEnableEXT on the builder.

Calls vkCmdSetStencilWriteMask on the builder.

Calls vkCmdSetScissor on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdSetScissorWithCountEXT on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdSetViewport on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdSetViewportWithCountEXT on the builder.

If the list is empty then the command is automatically ignored.

Calls vkCmdUpdateBuffer on the builder.

Calls vkCmdWriteTimestamp on the builder.

Builds a new SyncCommandBufferBuilder. The parameters are the same as the UnsafeCommandBufferBuilder::new function.

Safety

See UnsafeCommandBufferBuilder::new().

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.

Returns the binding/setting state.

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.

Builds the command buffer and turns it into a SyncCommandBuffer.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the device that owns Self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.