From 530bf463d7b4de53e66dd7151f7f14ec99882c1b Mon Sep 17 00:00:00 2001 From: "XTra.KrazzY" Date: Sun, 8 Mar 2009 00:58:11 +0000 Subject: [PATCH] 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 --- .../Plugins/Plugin_VideoDX9/Src/D3DShader.cpp | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp index c9afe6ca43..0e029854b7 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DShader.cpp @@ -40,11 +40,12 @@ LPDIRECT3DVERTEXSHADER9 CompileVertexShader(const char *code, int len, bool asse if (FAILED(hr)) { //compilation error - std::string hello = (char*)errorBuffer->GetBufferPointer(); - hello += "\n\n"; - hello += code; - if(g_Config.bShowShaderErrors) + if(g_Config.bShowShaderErrors) { + std::string hello = (char*)errorBuffer->GetBufferPointer(); + hello += "\n\n"; + hello += code; MessageBox(0, hello.c_str(), "Error assembling vertex shader", MB_ICONERROR); + } vShader = 0; } else if (SUCCEEDED(hr)) @@ -84,18 +85,19 @@ LPDIRECT3DPIXELSHADER9 CompilePixelShader(const char *code, int len, bool assemb if (FAILED(hr)) { - std::string hello = (char*)errorBuffer->GetBufferPointer(); - hello += "\n\n"; - hello += code; - if(g_Config.bShowShaderErrors) + if(g_Config.bShowShaderErrors) { + std::string hello = (char*)errorBuffer->GetBufferPointer(); + hello += "\n\n"; + hello += code; MessageBox(0, hello.c_str(), "Error assembling pixel shader", MB_ICONERROR); + } pShader = 0; } else { //create it 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); }