Conversation
Implements #60 for the DirectX 12 back-end.
Also fix image transfer footprints.
β¦initialization.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe the pull request
This PR introduces a large overhaul over command buffers. Currently command buffers are merely a shallow placeholder for specializations, that are actually responsible for holding the underlying command buffer instance. This means, that command buffers are always end up being used like this:
commandBuffer->handle()->nativeCall(...);With this PR, commands can be directly pushed to command buffers. Most notably:
IRenderPipeline::drawandIRenderPipeline::drawIndexed)IComputePipeline::dispatch)IPipeline::bind) βThe advantage of this design is, that it is more clear where to create a workload. Furthermore, it allows frame buffers to simply expose a set of command buffers, where the application can pick one (for example from an thread ID). Ending a render pass will send all command buffers to the parent queue and set a fence accordingly.
The
submit-member of the command buffer will be moved to the command queue interface, adding an overload that accepts multiple command buffers at once. This will improve performance for multi-threaded workloads. Each command buffer submit will place a fence (or timeline semaphore in Vulkan), that can be waited for on the parent queue. This resolves #57. In Vulkan this is implemented using timeline semaphores, so this also closes #24.In order to move transfers out of the buffer interface, it is required to first implement an explicit barrier interface. This will decouple state transitions from internal buffer states, thus removing the dependency on a command buffer object.
Since barriers operate on the base buffer and image interfaces and casting between them is not intuitive, this PR also remove the distinction between textures and images, as described in #60.
Finally, this PR will introduce support for multi-threaded rendering by exposing multiple command buffers from a frame buffer.
β
Notable exception: pipeline state binding (IPipeline::use) is still implemented using a member of the pipeline interface, but instead are passed a command buffer reference. This is might be refactored in the future.Related issues
IImageandITextureinto one interface.Β #60