not-much-of-a-performance-increasing fix for shader compile errors

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2613 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
XTra.KrazzY 2009-03-08 00:58:11 +00:00
parent eab121ea31
commit 530bf463d7
1 changed files with 11 additions and 9 deletions

View File

@ -40,11 +40,12 @@ LPDIRECT3DVERTEXSHADER9 CompileVertexShader(const char *code, int len, bool asse
if (FAILED(hr)) if (FAILED(hr))
{ {
//compilation error //compilation error
std::string hello = (char*)errorBuffer->GetBufferPointer(); if(g_Config.bShowShaderErrors) {
hello += "\n\n"; std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += code; hello += "\n\n";
if(g_Config.bShowShaderErrors) hello += code;
MessageBox(0, hello.c_str(), "Error assembling vertex shader", MB_ICONERROR); MessageBox(0, hello.c_str(), "Error assembling vertex shader", MB_ICONERROR);
}
vShader = 0; vShader = 0;
} }
else if (SUCCEEDED(hr)) else if (SUCCEEDED(hr))
@ -84,18 +85,19 @@ LPDIRECT3DPIXELSHADER9 CompilePixelShader(const char *code, int len, bool assemb
if (FAILED(hr)) if (FAILED(hr))
{ {
std::string hello = (char*)errorBuffer->GetBufferPointer(); if(g_Config.bShowShaderErrors) {
hello += "\n\n"; std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += code; hello += "\n\n";
if(g_Config.bShowShaderErrors) hello += code;
MessageBox(0, hello.c_str(), "Error assembling pixel shader", MB_ICONERROR); MessageBox(0, hello.c_str(), "Error assembling pixel shader", MB_ICONERROR);
}
pShader = 0; pShader = 0;
} }
else else
{ {
//create it //create it
HRESULT hr = D3D::dev->CreatePixelShader((DWORD *)shaderBuffer->GetBufferPointer(), &pShader); HRESULT hr = D3D::dev->CreatePixelShader((DWORD *)shaderBuffer->GetBufferPointer(), &pShader);
if (FAILED(hr) || pShader == 0) if ((FAILED(hr) || pShader == 0) && g_Config.bShowShaderErrors)
{ {
MessageBox(0, "damn", "error creating pixelshader", MB_ICONERROR); MessageBox(0, "damn", "error creating pixelshader", MB_ICONERROR);
} }