THIS BREAKS THE D3D PLUGIN FOR THE NEAR TERM. Resurrect an old patch that moves D3D over to the common shader generator framework. Needs a lot more work.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2484 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2009-02-28 22:10:38 +00:00
parent ee44b2a639
commit ecbfec2a13
49 changed files with 1087 additions and 4262 deletions

View File

@ -24,7 +24,7 @@
namespace D3D
{
LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len)
LPDIRECT3DVERTEXSHADER9 CompileVertexShader(const char *code, int len)
{
//try to compile
LPD3DXBUFFER shaderBuffer = 0;
@ -43,8 +43,7 @@ LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len)
std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += "\n\n";
hello += code;
if (g_Config.bShowShaderErrors)
MessageBox(0, hello.c_str(), "Error compiling vertex shader", MB_ICONERROR);
MessageBox(0, hello.c_str(), "Error compiling vertex shader", MB_ICONERROR);
vShader = 0;
}
else if (SUCCEEDED(hr))
@ -55,8 +54,7 @@ LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len)
hr = D3D::dev->CreateVertexShader((DWORD *)shaderBuffer->GetBufferPointer(), &vShader);
if (FAILED(hr) || vShader == 0)
{
if (g_Config.bShowShaderErrors)
MessageBox(0,code,(char*)errorBuffer->GetBufferPointer(),MB_ICONERROR);
MessageBox(0, code, (char*)errorBuffer->GetBufferPointer(),MB_ICONERROR);
}
}
@ -69,7 +67,7 @@ LPDIRECT3DVERTEXSHADER9 CompileVShader(const char *code, int len)
return vShader;
}
LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len)
LPDIRECT3DPIXELSHADER9 CompilePixelShader(const char *code, int len)
{
LPD3DXBUFFER shaderBuffer = 0;
LPD3DXBUFFER errorBuffer = 0;
@ -83,8 +81,7 @@ LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len)
std::string hello = (char*)errorBuffer->GetBufferPointer();
hello += "\n\n";
hello += code;
if (g_Config.bShowShaderErrors)
MessageBox(0, hello.c_str(), "Error compiling pixel shader", MB_ICONERROR);
MessageBox(0, hello.c_str(), "Error compiling pixel shader", MB_ICONERROR);
pShader = 0;
}
else
@ -93,8 +90,7 @@ LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len)
HRESULT hr = D3D::dev->CreatePixelShader((DWORD *)shaderBuffer->GetBufferPointer(), &pShader);
if (FAILED(hr) || pShader == 0)
{
if (g_Config.bShowShaderErrors)
MessageBox(0,"damn","error creating pixelshader",MB_ICONERROR);
MessageBox(0, "damn", "error creating pixelshader", MB_ICONERROR);
}
}
@ -106,4 +102,5 @@ LPDIRECT3DPIXELSHADER9 CompilePShader(const char *code, int len)
return pShader;
}
}
} // namespace