mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-14 16:29:21 +01:00
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:
parent
6c0c97cffe
commit
b3553eb53c
@ -153,6 +153,24 @@ void AddVertices(int _primitive, int _numVertices)
|
|||||||
AddIndices(_primitive, _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)
|
inline void Draw(int stride)
|
||||||
{
|
{
|
||||||
if(IndexGenerator::GetNumTriangles() > 0)
|
if(IndexGenerator::GetNumTriangles() > 0)
|
||||||
@ -165,13 +183,7 @@ inline void Draw(int stride)
|
|||||||
LocalVBuffer,
|
LocalVBuffer,
|
||||||
stride)))
|
stride)))
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
DumpBadShaders();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
||||||
}
|
}
|
||||||
@ -185,13 +197,7 @@ inline void Draw(int stride)
|
|||||||
LocalVBuffer,
|
LocalVBuffer,
|
||||||
stride)))
|
stride)))
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
DumpBadShaders();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
||||||
}
|
}
|
||||||
@ -205,13 +211,7 @@ inline void Draw(int stride)
|
|||||||
LocalVBuffer,
|
LocalVBuffer,
|
||||||
stride)))
|
stride)))
|
||||||
{
|
{
|
||||||
#if defined(_DEBUG) || defined(DEBUGFAST)
|
DumpBadShaders();
|
||||||
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
|
|
||||||
}
|
}
|
||||||
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
INCSTAT(stats.thisFrame.numIndexedDrawCalls);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user