[D3D12] Code style fixes

This commit is contained in:
Triang3l
2018-10-07 17:30:12 +03:00
parent 400e6b7137
commit 3de2b5e692
5 changed files with 15 additions and 17 deletions

View File

@@ -15,11 +15,11 @@ namespace xe {
namespace ui {
namespace d3d12 {
std::unique_ptr<CommandList>
CommandList::Create(ID3D12Device* device, ID3D12CommandQueue* queue,
D3D12_COMMAND_LIST_TYPE type) {
std::unique_ptr<CommandList> command_list(new CommandList(device, queue,
type));
std::unique_ptr<CommandList> CommandList::Create(ID3D12Device* device,
ID3D12CommandQueue* queue,
D3D12_COMMAND_LIST_TYPE type) {
std::unique_ptr<CommandList> command_list(
new CommandList(device, queue, type));
if (!command_list->Initialize()) {
return nullptr;
}
@@ -44,7 +44,7 @@ CommandList::~CommandList() {
bool CommandList::Initialize() {
if (FAILED(device_->CreateCommandAllocator(
type_, IID_PPV_ARGS(&command_allocator_)))) {
type_, IID_PPV_ARGS(&command_allocator_)))) {
XELOGE("Failed to create a command allocator");
return false;
}
@@ -68,9 +68,7 @@ ID3D12GraphicsCommandList* CommandList::BeginRecording() {
return command_list_;
}
void CommandList::AbortRecording() {
command_list_->Close();
}
void CommandList::AbortRecording() { command_list_->Close(); }
void CommandList::Execute() {
command_list_->Close();
@@ -81,4 +79,3 @@ void CommandList::Execute() {
} // namespace d3d12
} // namespace ui
} // namespace xe

View File

@@ -15,8 +15,8 @@ namespace xe {
namespace ui {
namespace d3d12 {
std::unique_ptr<CPUFence>
CPUFence::Create(ID3D12Device* device, ID3D12CommandQueue* queue) {
std::unique_ptr<CPUFence> CPUFence::Create(ID3D12Device* device,
ID3D12CommandQueue* queue) {
std::unique_ptr<CPUFence> fence(new CPUFence(device, queue));
if (!fence->Initialize()) {
return nullptr;

View File

@@ -74,9 +74,9 @@ bool D3D12Context::Initialize() {
swap_chain_desc.Flags = 0;
IDXGISwapChain1* swap_chain_1;
if (FAILED(dxgi_factory->CreateSwapChainForHwnd(
provider->GetDirectQueue(),
static_cast<HWND>(target_window_->native_handle()), &swap_chain_desc,
nullptr, nullptr, &swap_chain_1))) {
provider->GetDirectQueue(),
static_cast<HWND>(target_window_->native_handle()),
&swap_chain_desc, nullptr, nullptr, &swap_chain_1))) {
XELOGE("Failed to create a DXGI swap chain");
Shutdown();
return false;