From c0ff73a588cf873b940032984e2c7f3e0f90ba23 Mon Sep 17 00:00:00 2001 From: Triang3l Date: Tue, 24 Jul 2018 15:14:16 +0300 Subject: [PATCH] [D3D12] Build and code format fixes --- src/xenia/gpu/d3d12/d3d12_shader.cc | 17 +++++------ src/xenia/gpu/d3d12/pipeline_cache.cc | 9 +++--- src/xenia/gpu/hlsl_shader_translator.cc | 38 ++++++++++++------------- src/xenia/ui/d3d12/d3d12_api.h | 2 +- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/xenia/gpu/d3d12/d3d12_shader.cc b/src/xenia/gpu/d3d12/d3d12_shader.cc index fa9edf390..3ed70d9db 100644 --- a/src/xenia/gpu/d3d12/d3d12_shader.cc +++ b/src/xenia/gpu/d3d12/d3d12_shader.cc @@ -16,7 +16,7 @@ #include "xenia/gpu/gpu_flags.h" DEFINE_bool(d3d12_shader_disasm, true, - "Disassemble translated shaders after compilation."); + "Disassemble translated shaders after compilation."); namespace xe { namespace gpu { @@ -52,11 +52,10 @@ bool D3D12Shader::Prepare() { // TODO(Triang3l): Choose the appropriate optimization level based on compile // time and how invariance is handled in vertex shaders. ID3DBlob* error_blob = nullptr; - bool compiled = - SUCCEEDED(D3DCompile(translated_binary_.data(), translated_binary_.size(), - nullptr, nullptr, nullptr, "main", target, - D3DCOMPILE_OPTIMIZATION_LEVEL0, 0, &blob_, - &error_blob)); + bool compiled = SUCCEEDED( + D3DCompile(translated_binary_.data(), translated_binary_.size(), nullptr, + nullptr, nullptr, "main", target, + D3DCOMPILE_OPTIMIZATION_LEVEL0, 0, &blob_, &error_blob)); if (!compiled) { XELOGE("%s shader %.16llX compilation failed!", target, ucode_data_hash()); @@ -65,14 +64,16 @@ bool D3D12Shader::Prepare() { if (compiled) { XELOGW("%s shader %.16llX compiled with warnings!", target, ucode_data_hash()); - XELOGW("%s", reinterpret_cast(error_blob->GetBufferPointer())); + XELOGW("%s", + reinterpret_cast(error_blob->GetBufferPointer())); XELOGW("HLSL source:"); // The buffer isn't terminated. translated_binary_.push_back(0); XELOGW("%s", reinterpret_cast(translated_binary_.data())); translated_binary_.pop_back(); } else { - XELOGE("%s", reinterpret_cast(error_blob->GetBufferPointer())); + XELOGE("%s", + reinterpret_cast(error_blob->GetBufferPointer())); XELOGE("HLSL source:"); translated_binary_.push_back(0); XELOGE("%s", reinterpret_cast(translated_binary_.data())); diff --git a/src/xenia/gpu/d3d12/pipeline_cache.cc b/src/xenia/gpu/d3d12/pipeline_cache.cc index 3dfa3090a..169c76fb2 100644 --- a/src/xenia/gpu/d3d12/pipeline_cache.cc +++ b/src/xenia/gpu/d3d12/pipeline_cache.cc @@ -13,6 +13,7 @@ #include "xenia/base/assert.h" #include "xenia/base/logging.h" +#include "xenia/base/profiling.h" #include "xenia/gpu/gpu_flags.h" #include "xenia/gpu/hlsl_shader_translator.h" @@ -28,9 +29,7 @@ PipelineCache::PipelineCache(RegisterFile* register_file, PipelineCache::~PipelineCache() { Shutdown(); } -void PipelineCache::Shutdown() { - ClearCache(); -} +void PipelineCache::Shutdown() { ClearCache(); } D3D12Shader* PipelineCache::LoadShader(ShaderType shader_type, uint32_t guest_address, @@ -47,8 +46,8 @@ D3D12Shader* PipelineCache::LoadShader(ShaderType shader_type, // Always create the shader and stash it away. // We need to track it even if it fails translation so we know not to try // again. - D3D12Shader* shader = new D3D12Shader(shader_type, data_hash, host_address, - dword_count); + D3D12Shader* shader = + new D3D12Shader(shader_type, data_hash, host_address, dword_count); shader_map_.insert({data_hash, shader}); return shader; diff --git a/src/xenia/gpu/hlsl_shader_translator.cc b/src/xenia/gpu/hlsl_shader_translator.cc index c75da2adf..197b58294 100644 --- a/src/xenia/gpu/hlsl_shader_translator.cc +++ b/src/xenia/gpu/hlsl_shader_translator.cc @@ -165,23 +165,23 @@ std::vector HlslShaderTranslator::CompleteTranslation() { // Common declarations. source.Append( - "cbuffer xe_system_constants : register(b0) {\n" - " float2 xe_viewport_inv_scale;\n" - " uint xe_vertex_index_endian;\n" - " uint xe_textures_are_3d;\n" - "};\n" - "\n" - "struct XeFloatConstantPage {\n" - " float4 c[16];\n" - "};\n" - "ConstantBuffer " - "xe_float_constants[16] : register(b1);\n" - "\n" - "cbuffer xe_loop_bool_constants : register(b17) {\n" - " uint xe_bool_constants[8];\n" - " uint xe_loop_constants[32];\n" - "};\n" - "\n"); + "cbuffer xe_system_constants : register(b0) {\n" + " float2 xe_viewport_inv_scale;\n" + " uint xe_vertex_index_endian;\n" + " uint xe_textures_are_3d;\n" + "};\n" + "\n" + "struct XeFloatConstantPage {\n" + " float4 c[16];\n" + "};\n" + "ConstantBuffer " + "xe_float_constants[16] : register(b1);\n" + "\n" + "cbuffer xe_loop_bool_constants : register(b17) {\n" + " uint xe_bool_constants[8];\n" + " uint xe_loop_constants[32];\n" + "};\n" + "\n"); if (is_vertex_shader()) { // Vertex fetching, output and prologue. @@ -307,8 +307,8 @@ std::vector HlslShaderTranslator::CompleteTranslation() { // Epilogue. if (!cf_wrote_pc_) { source.Append( - " xe_pc = 0xFFFFu;\n" - " break;\n"); + " xe_pc = 0xFFFFu;\n" + " break;\n"); } source.Append( " default:\n" diff --git a/src/xenia/ui/d3d12/d3d12_api.h b/src/xenia/ui/d3d12/d3d12_api.h index 53d0d3b8a..b3528a3f9 100644 --- a/src/xenia/ui/d3d12/d3d12_api.h +++ b/src/xenia/ui/d3d12/d3d12_api.h @@ -13,9 +13,9 @@ // This must be included before D3D and DXGI for things like NOMINMAX. #include "xenia/base/platform_win.h" -#include #include #include +#include #define XELOGD3D XELOGI