Skip to content

Commit

Permalink
Merge pull request #112 from crud89/command-queues
Browse files Browse the repository at this point in the history
Dedicated command queues.
  • Loading branch information
crud89 authored Dec 22, 2023
2 parents 2c8c1f9 + 840a1e2 commit c970423
Show file tree
Hide file tree
Showing 29 changed files with 4,651 additions and 4,485 deletions.
7 changes: 5 additions & 2 deletions docs/release-logs/0.4.1.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# LiteFX 0.4.1 - Alpha 04

- Adapt C++23 where applicable. ([See PR #98](https://github.com/crud89/LiteFX/pull/98) and [PR #102](https://github.com/crud89/LiteFX/pull/102)) This includes:
- Updated vcpkg to version 2023.11.20. ([See PR #104](https://github.com/crud89/LiteFX/pull/104))
- Adapt C++23 where applicable ([See PR #98](https://github.com/crud89/LiteFX/pull/98) and [PR #102](https://github.com/crud89/LiteFX/pull/102)). This includes:
- Many of the range adaptors could be simplified.
- The adaptor `ranges::to` has been replaced with the STL counterpart.
- A novel `Enumerable` container is introduced to pass around immutable collections.
- Some places that previously used `std::ranges::generate` or `std::generate` now use `std::generator`.
- Builders are now `constexpr` where possible and are implemented using `deducing this` in place of CRTP, which makes them more lightweight.
- Improvements to C++ core guideline conformance ([See PR #103](https://github.com/crud89/LiteFX/pull/103)).
- Improvements to C++ core guideline conformance. ([See PR #103](https://github.com/crud89/LiteFX/pull/103))
- New event infrastructure. ([See PR #81](https://github.com/crud89/LiteFX/pull/81))
- Add support for user-defined debug markers. ([See PR #82](https://github.com/crud89/LiteFX/pull/82))
- Improved resource allocation and binding: ([See PR #83](https://github.com/crud89/LiteFX/pull/83), [PR #110](https://github.com/crud89/LiteFX/pull/110) and [PR #111](https://github.com/crud89/LiteFX/pull/111))
Expand All @@ -19,6 +19,7 @@
- Command buffers can now be submitted with shared ownership to a command queue, which then stores them and releases the references, if the submit fence is passed (during `waitFor`).
- Command buffer transfers can now receive resources with shared ownership. Resource references are released in a similar fashion.
- To share ownership, the `asShared` function can be used.
- Allow manual command queue allocation for advanced parallel workloads. ([See PR #112](https://github.com/crud89/LiteFX/pull/112))
- Make most of the render pipeline state dynamic (viewports, scissors, ...). ([See PR #86](https://github.com/crud89/LiteFX/pull/86))
- Vector conversion to math types can now be done for constant vectors. ([See PR #87](https://github.com/crud89/LiteFX/pull/87))
- Backend types now import contra-variant interface functions instead of hiding them. ([See PR #91](https://github.com/crud89/LiteFX/pull/91))
Expand All @@ -31,6 +32,8 @@
- Raise minimum Vulkan SDK version to 1.3.204.1. ([See PR #86](https://github.com/crud89/LiteFX/pull/86) and [See PR #88](https://github.com/crud89/LiteFX/pull/88))
- `VK_EXT_debug_utils` is now enabled by default for the Vulkan backend in debug builds. ([See PR #82](https://github.com/crud89/LiteFX/pull/82))
- Images are now implicitly transitioned during transfer operations. ([See PR #93](https://github.com/crud89/LiteFX/pull/93))
- Command buffers no longer share a command pool, improving multi-threading behavior. ([See PR #112](https://github.com/crud89/LiteFX/pull/112))
- Queue allocation has also been reworked so that a queue from the most specialized queue family for a provided `QueueType` is returned.
- Empty descriptor sets are now allowed and may be automatically created to fill gaps in descriptor set space indices. ([See PR#110](https://github.com/crud89/LiteFX/pull/110))

**❎ DirectX 12:**
Expand Down
6 changes: 3 additions & 3 deletions docs/tutorials/quick-start.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ Next, let's transfer the buffers to the GPU. We start of by storing the input as
```cxx
auto inputAssembler = m_pipeline->inputAssembler();
auto commandBuffer = m_device->bufferQueue().createCommandBuffer(true);
auto commandBuffer = m_device->defaultQueue(QueueType::Transfer).createCommandBuffer(true);
```

We then create a CPU visible vertex buffer and copy the vertex data into it:
Expand Down Expand Up @@ -525,7 +525,7 @@ m_cameraBindings->update(cameraBufferLayout.binding(), *m_cameraBuffer, 0);
Here we first allocate a descriptor set that holds our descriptor for the camera buffer. We then update the descriptor bound to register *0* to point to the GPU-visible camera buffer. Finally, with all the transfer commands being recorded to the command buffer, we can submit the buffer and wait for it to be executed:

```cxx
auto fence = m_device->bufferQueue().submit(commandBuffer);
auto fence = commandBuffer->submit();
m_device->bufferQueue().waitFor(fence);
commandBuffer = nullptr;
stagedVertices = nullptr;
Expand Down Expand Up @@ -684,7 +684,7 @@ glm::mat4 projection = glm::perspective(glm::radians(60.0f), aspectRatio, 0.0001
projection[1][1] *= -1.f; // Fix GLM clip coordinate scaling.
camera.ViewProjection = projection * view;

auto commandBuffer = m_device->bufferQueue().createCommandBuffer(true);
auto commandBuffer = m_device->defaultQueue(QueueType::Transfer).createCommandBuffer(true);
m_cameraStagingBuffer->map(reinterpret_cast<const void*>(&camera), sizeof(camera));
commandBuffer->transfer(*m_cameraStagingBuffer, *m_cameraBuffer);
commandBuffer->end(true, true);
Expand Down
Loading

0 comments on commit c970423

Please sign in to comment.