pub struct SyncCommandBufferBuilder<P> { /* 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.

The P generic is the same as UnsafeCommandBufferBuilder.

Implementations

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

Safety

See UnsafeCommandBufferBuilder::new() and SyncCommandBufferBuilder.

Builds a SyncCommandBufferBuilder from an existing UnsafeCommandBufferBuilder.

Safety

See UnsafeCommandBufferBuilder::new() and SyncCommandBufferBuilder.

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.

Builds the command buffer and turns it into a SyncCommandBuffer.

Calls vkBeginRenderPass on the builder.

Calls vkCmdBindIndexBuffer on the builder.

Calls vkCmdBindPipeline on the builder with a graphics pipeline.

Calls vkCmdBindPipeline on the builder with a compute pipeline.

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

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 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 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 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 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 vkCmdResetEvent on the builder.

Calls vkCmdSetBlendConstants on the builder.

Calls vkCmdSetDepthBias on the builder.

Calls vkCmdSetDepthBounds on the builder.

Calls vkCmdSetEvent on the builder.

Calls vkCmdSetLineWidth on the builder.

Calls vkCmdSetScissor 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 vkCmdUpdateBuffer on the builder.

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
Builds a pointer to this type from a raw pointer.
Returns true if the size is suitable to store a type like this.
Returns the size of an individual element.

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.