when dumping shaders from VertexManager.cpp, don't overwrite old ones.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4493 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Shawn Hoffman 2009-11-01 02:03:26 +00:00
parent 6c0c97cffe
commit b3553eb53c
1 changed files with 46 additions and 46 deletions

View File

@ -153,6 +153,24 @@ void AddVertices(int _primitive, int _numVertices)
AddIndices(_primitive, _numVertices);
}
inline void DumpBadShaders()
{
#if defined(_DEBUG) || defined(DEBUGFAST)
std::string error_shaders;
error_shaders.append(VertexShaderCache::GetCurrentShaderCode());
error_shaders.append(PixelShaderCache::GetCurrentShaderCode());
char filename[512] = "bad_shader_combo_0.txt";
int which = 0;
while (File::Exists(filename))
{
which++;
sprintf(filename, "bad_shader_combo_%i.txt", which);
}
File::WriteStringToFile(true, error_shaders, filename);
PanicAlert("DrawIndexedPrimitiveUP failed. Shaders written to %s", filename);
#endif
}
inline void Draw(int stride)
{
if(IndexGenerator::GetNumTriangles() > 0)
@ -165,13 +183,7 @@ inline void Draw(int stride)
LocalVBuffer,
stride)))
{
#if defined(_DEBUG) || defined(DEBUGFAST)
std::string error_shaders;
error_shaders.append(VertexShaderCache::GetCurrentShaderCode());
error_shaders.append(PixelShaderCache::GetCurrentShaderCode());
File::WriteStringToFile(true, error_shaders, "bad_shader_combo.txt");
PanicAlert("DrawIndexedPrimitiveUP failed. Shaders written to bad_shader_combo.txt.");
#endif
DumpBadShaders();
}
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}
@ -185,13 +197,7 @@ inline void Draw(int stride)
LocalVBuffer,
stride)))
{
#if defined(_DEBUG) || defined(DEBUGFAST)
std::string error_shaders;
error_shaders.append(VertexShaderCache::GetCurrentShaderCode());
error_shaders.append(PixelShaderCache::GetCurrentShaderCode());
File::WriteStringToFile(true, error_shaders, "bad_shader_combo.txt");
PanicAlert("DrawIndexedPrimitiveUP failed. Shaders written to bad_shader_combo.txt.");
#endif
DumpBadShaders();
}
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}
@ -205,13 +211,7 @@ inline void Draw(int stride)
LocalVBuffer,
stride)))
{
#if defined(_DEBUG) || defined(DEBUGFAST)
std::string error_shaders;
error_shaders.append(VertexShaderCache::GetCurrentShaderCode());
error_shaders.append(PixelShaderCache::GetCurrentShaderCode());
File::WriteStringToFile(true, error_shaders, "bad_shader_combo.txt");
PanicAlert("DrawIndexedPrimitiveUP failed. Shaders written to bad_shader_combo.txt.");
#endif
DumpBadShaders();
}
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
}