#include <command_queue.h>
Manages a ID3D12CommandQueue.
The CommandQueue wraps all functionality from a ID3D12CommandQueue. It handles the CommandQueue in a way that allows for smart CPU/GPU synchronization. It generates a fence value specifically for this type of CommandQueue. See remarks for an explanation of fence values. Additionally, the CommandQueue manages a CommandAllocatorPool for the type of CommandQueue that this is. If you need a CommandAllocator, you should request it through the CommandQueue.
blowbox::CommandQueue::CommandQueue |
( |
D3D12_COMMAND_LIST_TYPE |
type | ) |
|
Constructs a CommandQueue of a certain type.
- Parameters
-
[in] | type | The type of command queue that should be created. |
blowbox::CommandQueue::~CommandQueue |
( |
| ) |
|
void blowbox::CommandQueue::DiscardAllocator |
( |
uint64_t |
fence_value, |
|
|
ID3D12CommandAllocator * |
allocator |
|
) |
| |
Discards a ID3D12CommandAllocator back into the CommandAllocatorPool as soon as the given fence_value has been passed.
- Parameters
-
[in] | fence_value | The fence value that needs to be passed before the ID3D12CommandAllocator can be repurposed. |
[in] | allocator | The allocator that you want to release back into the CommandAllocatorPool. |
uint64_t blowbox::CommandQueue::ExecuteCommandList |
( |
ID3D12CommandList * |
list | ) |
|
Submits a command list to the CommandQueue.
- Parameters
-
[in] | list | The list you want to submit |
- Returns
- A fence value that, once passed, means that the submitted command list has been completed.
ID3D12CommandQueue* blowbox::CommandQueue::Get |
( |
| ) |
|
|
inline |
- Returns
- The underlying ID3D12CommandQueue.
uint64_t blowbox::CommandQueue::IncrementFence |
( |
| ) |
|
bool blowbox::CommandQueue::IsFenceComplete |
( |
uint64_t |
fence_value | ) |
|
Checks if a certain fence value has been passed.
- Parameters
-
[in] | fence_value | The fence value you want to check if it was passed. |
ID3D12CommandAllocator * blowbox::CommandQueue::RequestAllocator |
( |
| ) |
|
Requests a ID3D12CommandAllocator from the underlying CommandAllocatorPool.
- Returns
- A ID3D12CommandAllocator which is ready for use.
void blowbox::CommandQueue::StallForFence |
( |
uint64_t |
fence_value | ) |
|
Makes this CommandQueue wait with execution until the given fence value is hit. See remarks!
- Parameters
-
[in] | fence_value | The fence value you want this CommandQueue to wait for. |
void blowbox::CommandQueue::StallForProducer |
( |
CommandQueue * |
producer | ) |
|
void blowbox::CommandQueue::WaitForFence |
( |
uint64_t |
fence_value | ) |
|
Makes the CommandQueue wait for a given fence value.
- Parameters
-
[in] | fence_value | The fence value you want to wait on. |
void blowbox::CommandQueue::WaitForIdle |
( |
| ) |
|
Makes the CommandQueue wait for until it is completely empty (i.e. the GPU finished all the work submitted to this CommandQueue).
ID3D12Fence* blowbox::CommandQueue::fence_ |
|
private |
The ID3D12Fence object that we use to synchronize the CPU with the GPU.
HANDLE blowbox::CommandQueue::fence_event_handle_ |
|
private |
A handle to an event that we use to synchronize the CPU with the GPU.
uint64_t blowbox::CommandQueue::last_completed_fence_value_ |
|
private |
The fence value that was most recently completed by the GPU.
uint64_t blowbox::CommandQueue::next_fence_value_ |
|
private |
The next fence value that should be used when we want to submit a new unit of work.
ID3D12CommandQueue* blowbox::CommandQueue::queue_ |
|
private |
The actual ID3D12CommandQueue.
D3D12_COMMAND_LIST_TYPE blowbox::CommandQueue::type_ |
|
private |
The documentation for this class was generated from the following files:
- C:/Projects/blowbox-2017/src/renderer/commands/command_queue.h
- C:/Projects/blowbox-2017/src/renderer/commands/command_queue.cc