diff --git a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp index d2ed9f30b6..4cf6f0529c 100644 --- a/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp +++ b/rpcs3/Emu/RSX/D3D12/D3D12PipelineState.cpp @@ -13,15 +13,20 @@ void Shader::Compile(const std::string &code, SHADER_TYPE st) { HRESULT hr; ComPtr errorBlob; + UINT compileFlags; + if (Ini.GSDebugOutputEnable.GetValue()) + compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; + else + compileFlags = 0; switch (st) { case SHADER_TYPE::SHADER_TYPE_VERTEX: - hr = D3DCompile(code.c_str(), code.size(), "VertexProgram.hlsl", nullptr, nullptr, "main", "vs_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf()); + hr = D3DCompile(code.c_str(), code.size(), "VertexProgram.hlsl", nullptr, nullptr, "main", "vs_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf()); if (hr != S_OK) LOG_ERROR(RSX, "VS build failed:%s", errorBlob->GetBufferPointer()); break; case SHADER_TYPE::SHADER_TYPE_FRAGMENT: - hr = D3DCompile(code.c_str(), code.size(), "FragmentProgram.hlsl", nullptr, nullptr, "main", "ps_5_0", 0, 0, &bytecode, errorBlob.GetAddressOf()); + hr = D3DCompile(code.c_str(), code.size(), "FragmentProgram.hlsl", nullptr, nullptr, "main", "ps_5_0", compileFlags, 0, &bytecode, errorBlob.GetAddressOf()); if (hr != S_OK) LOG_ERROR(RSX, "FS build failed:%s", errorBlob->GetBufferPointer()); break;