Blowbox 2017
A 3D Game Engine by Riko Ophorst using DirectX 12
command_manager.h
1 #pragma once
2 
3 #include "renderer/d3d12_includes.h"
4 
5 #include "util/shared_ptr.h"
6 #include "util/weak_ptr.h"
7 
8 namespace blowbox
9 {
10  class Device;
11  class CommandQueue;
12  class CommandList;
13 
29  {
30  public:
35 
37  void Startup();
38 
45  void CreateCommandList(D3D12_COMMAND_LIST_TYPE type, ID3D12GraphicsCommandList** out_list, ID3D12CommandAllocator** out_allocator);
46 
51  CommandQueue* GetQueue(D3D12_COMMAND_LIST_TYPE type = D3D12_COMMAND_LIST_TYPE_DIRECT);
52 
55 
58 
61 
64 
72  bool IsFenceComplete(uint64_t fence_value);
73 
75  void WaitForIdleGPU();
76 
84  void WaitForFence(uint64_t fence_value);
85 
86  private:
90  };
91 }
CommandQueue * copy_queue_
The copy CommandQueue.
Definition: command_manager.h:89
CommandQueue * GetComputeQueue()
Definition: command_manager.cc:96
~CommandManager()
Destructs the CommandManager.
Definition: command_manager.cc:19
CommandQueue * GetCommandQueue()
Definition: command_manager.cc:84
bool IsFenceComplete(uint64_t fence_value)
Checks if a given fence value (point in time) has been passed by the corresponding command queue...
Definition: command_manager.cc:108
void CreateCommandList(D3D12_COMMAND_LIST_TYPE type, ID3D12GraphicsCommandList **out_list, ID3D12CommandAllocator **out_allocator)
Creates a ID3D12GraphicsCommandList with an ID3D12CommandAllocator that is ready for use...
Definition: command_manager.cc:39
CommandQueue * GetGraphicsQueue()
Definition: command_manager.cc:90
CommandQueue * graphics_queue_
The graphics CommandQueue.
Definition: command_manager.h:87
void Startup()
Starts up the CommandManager.
Definition: command_manager.cc:27
void WaitForFence(uint64_t fence_value)
This function is blocking until a given fence point is hit by the corresponding CommandQueue.
Definition: command_manager.cc:122
CommandQueue * GetQueue(D3D12_COMMAND_LIST_TYPE type=D3D12_COMMAND_LIST_TYPE_DIRECT)
Definition: command_manager.cc:63
The main Blowbox namespace.
Definition: image.cc:8
CommandQueue * GetCopyQueue()
Definition: command_manager.cc:102
Manages a ID3D12CommandQueue.
Definition: command_queue.h:23
void WaitForIdleGPU()
This function is blocking until all pending work in the CommandQueues is done executing.
Definition: command_manager.cc:114
CommandQueue * compute_queue_
The compute CommandQueue.
Definition: command_manager.h:88
Manages all the CommandQueues in the application.
Definition: command_manager.h:28
CommandManager()
Constructs the CommandManager.
Definition: command_manager.cc:10