[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

@ -399,12 +399,12 @@ PrimitiveConverter::ConversionResult PrimitiveConverter::ConvertPrimitives(
} }
} else if (source_type == PrimitiveType::kTriangleStrip || } else if (source_type == PrimitiveType::kTriangleStrip ||
source_type == PrimitiveType::kLineStrip) { source_type == PrimitiveType::kLineStrip) {
#if XE_ARCH_AMD64
// Replace the reset index with the maximum representable value - vector OR // Replace the reset index with the maximum representable value - vector OR
// gives 0 or 0xFFFF/0xFFFFFFFF, which is exactly what is needed. // gives 0 or 0xFFFF/0xFFFFFFFF, which is exactly what is needed.
// Allocations in the target index buffer are aligned with 16-byte // Allocations in the target index buffer are aligned with 16-byte
// granularity, and within 16-byte vectors, both the source and the target // granularity, and within 16-byte vectors, both the source and the target
// start at the same offset. // start at the same offset.
#if XE_ARCH_AMD64
union { union {
const __m128i* source_aligned_128; const __m128i* source_aligned_128;
uintptr_t source_aligned_uintptr; uintptr_t source_aligned_uintptr;

View File

@ -7476,9 +7476,10 @@ void DxbcShaderTranslator::WriteResourceDefinitions() {
shader_object_.push_back(0); shader_object_.push_back(0);
shader_object_.push_back(type_name_offsets[i]); shader_object_.push_back(type_name_offsets[i]);
} }
#if 0
// Structure members. Structures are not used currently, but were used in the // Structure members. Structures are not used currently, but were used in the
// past, so the code is kept here. // past, so the code is kept here.
#if 0
for (uint32_t i = 0; i < uint32_t(RdefTypeIndex::kCount); ++i) { for (uint32_t i = 0; i < uint32_t(RdefTypeIndex::kCount); ++i) {
const RdefType& type = rdef_types_[i]; const RdefType& type = rdef_types_[i];
const RdefStructMember* struct_members = type.struct_members; const RdefStructMember* struct_members = type.struct_members;

View File

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

View File

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

View File

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