mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-08 07:51:28 +12:00
d3d12: Build shader in debug mode if debug output is enabled.
This commit is contained in:
parent
05c5058dfd
commit
7d15cc0dfd
1 changed files with 7 additions and 2 deletions
|
@ -13,15 +13,20 @@ void Shader::Compile(const std::string &code, SHADER_TYPE st)
|
||||||
{
|
{
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
ComPtr<ID3DBlob> errorBlob;
|
ComPtr<ID3DBlob> errorBlob;
|
||||||
|
UINT compileFlags;
|
||||||
|
if (Ini.GSDebugOutputEnable.GetValue())
|
||||||
|
compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION;
|
||||||
|
else
|
||||||
|
compileFlags = 0;
|
||||||
switch (st)
|
switch (st)
|
||||||
{
|
{
|
||||||
case SHADER_TYPE::SHADER_TYPE_VERTEX:
|
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)
|
if (hr != S_OK)
|
||||||
LOG_ERROR(RSX, "VS build failed:%s", errorBlob->GetBufferPointer());
|
LOG_ERROR(RSX, "VS build failed:%s", errorBlob->GetBufferPointer());
|
||||||
break;
|
break;
|
||||||
case SHADER_TYPE::SHADER_TYPE_FRAGMENT:
|
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)
|
if (hr != S_OK)
|
||||||
LOG_ERROR(RSX, "FS build failed:%s", errorBlob->GetBufferPointer());
|
LOG_ERROR(RSX, "FS build failed:%s", errorBlob->GetBufferPointer());
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue