diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp index 7d4ae6f7fb..c9afe6ca43 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp @@ -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 diff --git a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp index 4fb7b82ef1..10c40d769e 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/PixelShaderCache.cpp @@ -20,6 +20,7 @@ #include "Statistics.h" #include "Utils.h" #include "Profiler.h" +#include "Config.h" #include "PixelShaderGen.h" #include "PixelShaderManager.h" #include "PixelShaderCache.h" @@ -99,7 +100,7 @@ void PixelShaderCache::SetShader() INCSTAT(stats.numPixelShadersCreated); SETSTAT(stats.numPixelShadersAlive, (int)PixelShaders.size()); - } else + } else if(g_Config.bShowShaderErrors) PanicAlert("Failed to compile Pixel Shader:\n\n%s", code); } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp index b4722a1b22..7851b02195 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Render.cpp @@ -73,6 +73,9 @@ static std::list s_listMsgs; void HandleCgError(CGcontext ctx, CGerror err, void* appdata) { + if(!g_Config.bShowShaderErrors) + return; + PanicAlert("Cg error: %s\n", cgGetErrorString(err)); const char* listing = cgGetLastListing(g_cgcontext); if (listing != NULL) { diff --git a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp index e9aa4aff73..90f9b3e2bb 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/VertexShaderCache.cpp @@ -22,6 +22,7 @@ #include "Statistics.h" #include "Utils.h" #include "Profiler.h" +#include "Config.h" #include "VertexShaderCache.h" #include "VertexLoader.h" #include "BPMemory.h" @@ -100,9 +101,8 @@ void VertexShaderCache::SetShader(u32 components) INCSTAT(stats.numVertexShadersCreated); SETSTAT(stats.numVertexShadersAlive, (int)vshaders.size()); - } else { + } else if(g_Config.bShowShaderErrors) PanicAlert("Failed to compile Vertex Shader:\n\n%s", code); - } D3D::dev->SetFVF(NULL); D3D::dev->SetVertexShader(shader);