Made "Show shader compilation errors" work in D3D. Some games actually work behind the curtain of shader compilation errors!

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2612 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY
2009-03-07 23:58:04 +00:00
parent c674e6330f
commit eab121ea31
4 changed files with 12 additions and 6 deletions

View File

@ -43,7 +43,8 @@ LPDIRECT3DVERTEXSHADER9 CompileVertexShader(const char *code, int len, bool asse
std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += "\n\n";
hello += code;
MessageBox(0, hello.c_str(), "Error assembling vertex shader", MB_ICONERROR);
if(g_Config.bShowShaderErrors)
MessageBox(0, hello.c_str(), "Error assembling vertex shader", MB_ICONERROR);
vShader = 0;
}
else if (SUCCEEDED(hr))
@ -52,7 +53,7 @@ LPDIRECT3DVERTEXSHADER9 CompileVertexShader(const char *code, int len, bool asse
HRESULT hr = E_FAIL;
if (shaderBuffer)
hr = D3D::dev->CreateVertexShader((DWORD *)shaderBuffer->GetBufferPointer(), &vShader);
if (FAILED(hr) || vShader == 0)
if ((FAILED(hr) || vShader == 0) && g_Config.bShowShaderErrors)
{
MessageBox(0, code, (char*)errorBuffer->GetBufferPointer(),MB_ICONERROR);
}
@ -86,7 +87,8 @@ LPDIRECT3DPIXELSHADER9 CompilePixelShader(const char *code, int len, bool assemb
std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += "\n\n";
hello += code;
MessageBox(0, hello.c_str(), "Error assembling pixel shader", MB_ICONERROR);
if(g_Config.bShowShaderErrors)
MessageBox(0, hello.c_str(), "Error assembling pixel shader", MB_ICONERROR);
pShader = 0;
}
else