[D3D12] Minor deferred command list refactoring

This commit is contained in:
Triang3l
2020-10-04 21:53:52 +03:00
parent 81ee7b4c39
commit 75bf2d3c7d
4 changed files with 67 additions and 61 deletions

View File

@@ -26,7 +26,7 @@ class D3D12CommandProcessor;
class DeferredCommandList {
public:
DeferredCommandList(D3D12CommandProcessor& command_processor,
DeferredCommandList(const D3D12CommandProcessor& command_processor,
size_t initial_size_bytes = 1024 * 1024);
void Reset();
@@ -196,6 +196,7 @@ class DeferredCommandList {
if (num_barriers == 0) {
return;
}
static_assert(alignof(D3D12_RESOURCE_BARRIER) <= alignof(uintmax_t));
const size_t header_size =
xe::align(sizeof(UINT), alignof(D3D12_RESOURCE_BARRIER));
uint8_t* args = reinterpret_cast<uint8_t*>(WriteCommand(
@@ -333,7 +334,7 @@ class DeferredCommandList {
}
private:
enum class Command : uint32_t {
enum class Command {
kD3DClearUnorderedAccessViewUint,
kD3DCopyBufferRegion,
kD3DCopyResource,
@@ -468,7 +469,7 @@ class DeferredCommandList {
void* WriteCommand(Command command, size_t arguments_size_bytes);
D3D12CommandProcessor& command_processor_;
const D3D12CommandProcessor& command_processor_;
// uintmax_t to ensure uint64_t and pointer alignment of all structures.
std::vector<uintmax_t> command_stream_;