#include <command_context.h>
|
| ~CommandContext () |
|
GraphicsContext & | GetGraphicsContext () |
|
ComputeContext & | GetComputeContext () |
|
void | Initialize () |
|
void | CopyBuffer (GpuResource &dest_resource, UploadBuffer &source_resource) |
|
void | CopyBuffer (GpuResource &dest_resource, GpuResource &source_resource) |
|
void | CopyBufferRegion (GpuResource &dest_resource, UINT dest_offset, GpuResource &source_resource, UINT source_offset, UINT num_bytes) |
|
void | CopySubresource (GpuResource &dest_resource, UINT dest_subresource_index, GpuResource &source_resource, UINT source_subresource_index) |
|
void | CopyCounter (GpuResource &dest_resource, UINT dest_offset, StructuredBuffer &source_resource) |
|
uint64_t | Flush (bool wait_for_completion=false) |
|
uint64_t | Finish (bool wait_for_completion=false) |
|
void | TransitionResource (GpuResource &resource, const D3D12_RESOURCE_STATES &new_state, bool flush_immediate=false) |
|
void | BeginResourceTransition (GpuResource &resource, const D3D12_RESOURCE_STATES &new_state, bool flush_immediate=false) |
|
void | InsertUAVBarrier (GpuResource &resource, bool flush_immediate=false) |
|
void | InsertAliasBuffer (GpuResource &before, GpuResource &after, bool flush_immediate=false) |
|
void | FlushResourceBarriers () |
|
void | InsertTimeStamp (ID3D12QueryHeap *query_heap, UINT query_idx) |
|
void | ResolveTimeStamps (ID3D12Resource *read_back_heap, ID3D12QueryHeap *query_heap, UINT num_queries) |
|
void | SetDescriptorHeap (D3D12_DESCRIPTOR_HEAP_TYPE type, ID3D12DescriptorHeap *heap) |
|
void | SetDescriptorHeaps (UINT heap_count, D3D12_DESCRIPTOR_HEAP_TYPE heap_types[], ID3D12DescriptorHeap *heaps[]) |
|
void | SetPredication (ID3D12Resource *buffer, UINT64 buffer_offset, D3D12_PREDICATION_OP op) |
|
ID3D12GraphicsCommandList * | Get () |
|
|
class | CommandContextManager |
|
Wrapper around D3D12 command lists.
This is a wrapper that makes it very simple and straightforward to interact with command lists. Start a new CommandContext by calling CommandContext::Begin(name) and complete it by calling ComandContext::Finish() or CommandContext::Flush().
blowbox::CommandContext::CommandContext |
( |
D3D12_COMMAND_LIST_TYPE |
type | ) |
|
|
private |
blowbox::CommandContext::~CommandContext |
( |
| ) |
|
Begins a new CommandContext.
Use this function to start a new CommandContext. It will collect all necessary resources for you to start using it.
- Parameters
-
void blowbox::CommandContext::BeginResourceTransition |
( |
GpuResource & |
resource, |
|
|
const D3D12_RESOURCE_STATES & |
new_state, |
|
|
bool |
flush_immediate = false |
|
) |
| |
Begins to transition a GpuResource into another state.
- Parameters
-
[in] | resource | The resource that should be transitioned. |
[in] | new_state | The new state that the resource should be in. |
[in] | flush_immediate | Whether the transition should be pushed through immediately to the command list. |
void blowbox::CommandContext::BindDescriptorHeaps |
( |
| ) |
|
|
protected |
Actually binds the descriptor heaps to the pipeline.
Copies a resource into another resource.
- Parameters
-
[in] | dest_resource | The resource into which the source_resource should be copied. |
[in] | source_resource | The resource that contains the data to be copied over into the dest_resource. |
Copies a resource into another resource.
- Parameters
-
[in] | dest_resource | The resource into which the source_resource should be copied. |
[in] | source_resource | The resource that contains the data to be copied over into the dest_resource. |
void blowbox::CommandContext::CopyBufferRegion |
( |
GpuResource & |
dest_resource, |
|
|
UINT |
dest_offset, |
|
|
GpuResource & |
source_resource, |
|
|
UINT |
source_offset, |
|
|
UINT |
num_bytes |
|
) |
| |
Copies a region of a resource into another resource.
- Parameters
-
[in] | dest_resource | The resource into which the source_resource should be copied. |
[in] | dest_offset | The offset in the dest_resource into which will be copied. |
[in] | source_resource | The resource that contains the data to be copied over into the dest_resource. |
[in] | source_offset | The offset in the source_resource from where will be copied. |
[in] | num_bytes | The number of bytes from the offset on that should be copied. |
Copies a Counter buffer from a StructuredBuffer into another resource.
- Parameters
-
[in] | dest_resource | The resource into which the counter buffer should be copied. |
[in] | dest_offset | The offset in the dest_resource into which will be copied. |
[in] | source_resource | The StructuredBuffer from which the Counter buffer should be copied. |
void blowbox::CommandContext::CopySubresource |
( |
GpuResource & |
dest_resource, |
|
|
UINT |
dest_subresource_index, |
|
|
GpuResource & |
source_resource, |
|
|
UINT |
source_subresource_index |
|
) |
| |
Copies a subresource from one resource into another.
- Parameters
-
[in] | dest_resource | The resource into which the source_resource should be copied. |
[in] | dest_subresource_index | The index into which the source subresource should be copied. |
[in] | source_resource | The resource that contains the data to be copied over into the dest_resource. |
[in] | source_subresource_index | The index from where the source subresource should be copied. |
uint64_t blowbox::CommandContext::Finish |
( |
bool |
wait_for_completion = false | ) |
|
This finishes the CommandContext. That means that it will submit everything to the correct CommandQueue, while also releasing its resources.
- Parameters
-
[in] | wait_for_completion | Whether the function should be blocking until all the work has been completed by the GPU. |
uint64_t blowbox::CommandContext::Flush |
( |
bool |
wait_for_completion = false | ) |
|
This flushes the CommandContext. That means that it will submit everything to the correct CommandQueue, without releasing its resources.
- Parameters
-
[in] | wait_for_completion | Whether the function should be blocking until all the work has been completed by the GPU. |
void blowbox::CommandContext::FlushResourceBarriers |
( |
| ) |
|
Flushes all queued up resource barriers by submitting them to the command list.
ID3D12GraphicsCommandList * blowbox::CommandContext::Get |
( |
| ) |
|
- Returns
- The underlying command list.
ComputeContext & blowbox::CommandContext::GetComputeContext |
( |
| ) |
|
void blowbox::CommandContext::Initialize |
( |
| ) |
|
Initializes the CommandContext, by creating all the resources that it needs.
void blowbox::CommandContext::InitializeBuffer |
( |
GpuResource & |
dest_resource, |
|
|
const void * |
data, |
|
|
UINT |
num_bytes, |
|
|
bool |
use_offset = false , |
|
|
UINT |
offset = 0 |
|
) |
| |
|
static |
Initialize a Buffer resource with supplied data.
- Parameters
-
[in] | dest_resource | The resource which has to be initialized with the data. |
[in] | data | The data that should be put into the dest_resource. |
[in] | num_bytes | The number of bytes in data. |
[in] | use_offset | Whether or not to use a certain offset when copying the data into the dest_resource. |
[in] | offset | The offset that should be used when copying the data into the dest_resource. |
void blowbox::CommandContext::InitializeTexture |
( |
GpuResource & |
dest_resource, |
|
|
UINT |
num_subresources, |
|
|
D3D12_SUBRESOURCE_DATA |
subresource_data[] |
|
) |
| |
|
static |
Initialize a Texture resource with supplied data.
- Parameters
-
[in] | dest_resource | The resource which has to be initialized with the data. |
[in] | num_subresources | The number of subresources that have to be set in the dest_resource. |
[in] | subresource_data | The actual data that you want the dest_resource to be initialized with. |
void blowbox::CommandContext::InsertAliasBuffer |
( |
GpuResource & |
before, |
|
|
GpuResource & |
after, |
|
|
bool |
flush_immediate = false |
|
) |
| |
Inserts an alias barrier.
- Parameters
-
[in] | before | fuck if i know |
[in] | after | fuck if i know |
[in] | flush_immediate | Whether the transition should be pushed through immediately to the command list. |
void blowbox::CommandContext::InsertTimeStamp |
( |
ID3D12QueryHeap * |
query_heap, |
|
|
UINT |
query_idx |
|
) |
| |
Inserts a timestamp. Fuck if I know what that means.
- Parameters
-
[in] | query_heap | no clue |
[in] | query_idx | no clue |
void blowbox::CommandContext::InsertUAVBarrier |
( |
GpuResource & |
resource, |
|
|
bool |
flush_immediate = false |
|
) |
| |
Inserts a UAV barrier.
- Parameters
-
[in] | resource | The resource that gets transitioned to a UAV state. |
[in] | flush_immediate | Whether the transition should be pushed through immediately to the command list. |
void blowbox::CommandContext::Reset |
( |
| ) |
|
|
private |
void blowbox::CommandContext::ResolveTimeStamps |
( |
ID3D12Resource * |
read_back_heap, |
|
|
ID3D12QueryHeap * |
query_heap, |
|
|
UINT |
num_queries |
|
) |
| |
Resolves the timestamps. No clue man.
- Parameters
-
[in] | read_back_heap | No clue. |
[in] | query_heap | No clue. |
[in] | num_queries | No clue. |
void blowbox::CommandContext::SetDescriptorHeap |
( |
D3D12_DESCRIPTOR_HEAP_TYPE |
type, |
|
|
ID3D12DescriptorHeap * |
heap |
|
) |
| |
Set a descriptor heap that is bound to the pipeline.
- Parameters
-
[in] | type | The type that you want bound to the pipeline. |
[in] | heap | The descriptor heap that should be bound to the pipeline. |
void blowbox::CommandContext::SetDescriptorHeaps |
( |
UINT |
heap_count, |
|
|
D3D12_DESCRIPTOR_HEAP_TYPE |
heap_types[], |
|
|
ID3D12DescriptorHeap * |
heaps[] |
|
) |
| |
Sets the descriptor heaps that should be bound to the pipeline.
- Parameters
-
[in] | heap_count | The number of heaps that need to be bound. |
[in] | heap_types | The types of heaps you want bound to the pipeline. |
[in] | heaps | The actual descriptor heaps that you want to bind to the pipeline. |
void blowbox::CommandContext::SetName |
( |
const WString & |
name | ) |
|
|
inlineprotected |
void blowbox::CommandContext::SetPredication |
( |
ID3D12Resource * |
buffer, |
|
|
UINT64 |
buffer_offset, |
|
|
D3D12_PREDICATION_OP |
op |
|
) |
| |
Sets a predication.
- Parameters
-
[in] | buffer | Yo i dunno man |
[in] | buffer_offset | Still dont know |
[in] | op | Definitely don't know now |
void blowbox::CommandContext::TransitionResource |
( |
GpuResource & |
resource, |
|
|
const D3D12_RESOURCE_STATES & |
new_state, |
|
|
bool |
flush_immediate = false |
|
) |
| |
Transitions a GpuResource into another state.
- Parameters
-
[in] | resource | The resource that should be transitioned. |
[in] | new_state | The new state that the resource should be in. |
[in] | flush_immediate | Whether the transition should be pushed through immediately to the command list. |
ID3D12CommandAllocator* blowbox::CommandContext::allocator_ |
|
protected |
The allocator used to allocate the commands.
ID3D12PipelineState* blowbox::CommandContext::compute_pipeline_state_ |
|
protected |
ID3D12RootSignature* blowbox::CommandContext::compute_root_signature_ |
|
protected |
The compute root signature that is currently bound.
ID3D12DescriptorHeap* blowbox::CommandContext::descriptor_heaps_[4] |
|
protected |
All DescriptorHeaps that are currently bound.
ID3D12PipelineState* blowbox::CommandContext::graphics_pipeline_state_ |
|
protected |
ID3D12RootSignature* blowbox::CommandContext::graphics_root_signature_ |
|
protected |
The graphics root signature that is currently bound.
ID3D12GraphicsCommandList* blowbox::CommandContext::list_ |
|
protected |
The actual underlying command list.
WString blowbox::CommandContext::name_ |
|
protected |
UINT blowbox::CommandContext::num_flushable_barriers_ |
|
protected |
The number of resource barriers that are queued up.
D3D12_RESOURCE_BARRIER blowbox::CommandContext::resource_barrier_buffer_[COMMAND_CONTEXT_BARRIER_BUFFER_SIZE] |
|
protected |
The actual queued up resource barriers.
D3D12_COMMAND_LIST_TYPE blowbox::CommandContext::type_ |
|
protected |
The documentation for this class was generated from the following files:
- C:/Projects/blowbox-2017/src/renderer/commands/command_context.h
- C:/Projects/blowbox-2017/src/renderer/commands/command_context.cc