Skip to content

Shared temporary ownership for command buffers and resources.#89

Merged
crud89 merged 8 commits intomainfrom
command-buffer-ownership
Mar 28, 2023
Merged

Shared temporary ownership for command buffers and resources.#89
crud89 merged 8 commits intomainfrom
command-buffer-ownership

Conversation

@crud89
Copy link
Copy Markdown
Owner

@crud89 crud89 commented Mar 27, 2023

Describe the pull request

This PR allows command queues to take temporary shared ownership over one or more command buffers during submit. Ownership is held until the submitted fence value has been surpassed. It is released during waitFor. This allows for temporary command buffers to stay alive, until they are executed. It is no longer necessary to manually manage and release such command buffers.

Similarly, transfer operations inside command buffers can take a temporary shared ownership over resources. If a command queue waits for a fence, all completed command buffers are asked to release the references shared this way. This is useful to implement "fire-and-forget" buffers, for example for staging purposes.

To make this possible, all command buffers are stored in shared pointers by default and the command queue only accepts shared command buffer pointers on submission. For resources, shared ownership can be enabled using asShared.

@crud89 crud89 added Priority: Medium A issue with normal priority. Type: Requirement Vulkan 🌋 The issue involves the Vulkan backend. DX12 ❎ The issue involves the DX12 backend. labels Mar 27, 2023
@crud89 crud89 added this to the Alpha #04 milestone Mar 27, 2023
@crud89 crud89 self-assigned this Mar 27, 2023
@crud89 crud89 marked this pull request as ready for review March 28, 2023 17:46
@crud89 crud89 merged commit daa3757 into main Mar 28, 2023
@crud89 crud89 deleted the command-buffer-ownership branch March 29, 2023 07:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

DX12 ❎ The issue involves the DX12 backend. Priority: Medium A issue with normal priority. Vulkan 🌋 The issue involves the Vulkan backend.

Projects

Status: v0.4.1

Development

Successfully merging this pull request may close these issues.

1 participant