[D3D12] Use deferred command list

This commit is contained in:
Triang3l
2019-01-03 15:08:49 +03:00
parent f0c662fa1e
commit 364cae6cc8
9 changed files with 169 additions and 192 deletions

View File

@@ -66,6 +66,13 @@ void DeferredCommandList::Execute(ID3D12GraphicsCommandList* command_list,
args.start_index_location, args.base_vertex_location,
args.start_instance_location);
} break;
case Command::kD3DDrawInstanced: {
auto& args =
*reinterpret_cast<const D3DDrawInstancedArguments*>(stream);
command_list->DrawInstanced(
args.vertex_count_per_instance, args.instance_count,
args.start_vertex_location, args.start_instance_location);
} break;
case Command::kD3DIASetIndexBuffer: {
auto view = reinterpret_cast<const D3D12_INDEX_BUFFER_VIEW*>(stream);
command_list->IASetIndexBuffer(
@@ -188,7 +195,6 @@ void DeferredCommandList::Execute(ID3D12GraphicsCommandList* command_list,
stream += header[1];
stream_remaining -= header[1];
}
Reset();
}
void* DeferredCommandList::WriteCommand(Command command,