summaryrefslogtreecommitdiff
path: root/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp
diff options
context:
space:
mode:
authorNeoBrainX <NeoBrainX@googlemail.com>2011-07-29 22:18:11 +0000
committerNeoBrainX <NeoBrainX@googlemail.com>2011-07-29 22:18:11 +0000
commit0655ee571d49493a2018ea819ebbb6eb9208fefd (patch)
treea0bcd5490a3f7c5e8120a8bb17fb72aa45d95484 /Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp
parent81807e3f2cac43ad89b69fa1f77fcb3c85c0da53 (diff)
Shader compilation error message modified to contain some helpful information for noobs (includes a reference to the full bad shader dump).
Removed the "Hide Shader Errors" option; hide shader errors if panic handlers are disabled now. Removed superfluous error messages about shader compilations; display only one error message instead. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7688 8ced0084-cf51-0410-be5f-012b33b47a6e
Diffstat (limited to 'Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp')
-rw-r--r--Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp
index 68e430be50..96f2d5a2ae 100644
--- a/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp
+++ b/Source/Plugins/Plugin_VideoOGL/Src/VertexShaderCache.cpp
@@ -38,7 +38,6 @@ namespace OGL
{
VertexShaderCache::VSCache VertexShaderCache::vshaders;
-bool VertexShaderCache::s_displayCompileAlert;
GLuint VertexShaderCache::CurrentShader;
bool VertexShaderCache::ShaderEnabled;
@@ -53,8 +52,6 @@ void VertexShaderCache::Init()
CurrentShader = 0;
memset(&last_vertex_shader_uid, 0xFF, sizeof(last_vertex_shader_uid));
- s_displayCompileAlert = true;
-
glGetProgramivARB(GL_VERTEX_PROGRAM_ARB, GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB, (GLint *)&s_nMaxVertexInstructions);
if (strstr((const char*)glGetString(GL_VENDOR), "Humper") != NULL) s_nMaxVertexInstructions = 4096;
#if CG_VERSION_NUM == 2100
@@ -114,7 +111,6 @@ VERTEXSHADER* VertexShaderCache::SetShader(u32 components)
#endif
if (!code || !VertexShaderCache::CompileVertexShader(entry.shader, code)) {
- ERROR_LOG(VIDEO, "failed to create vertex shader");
GFX_DEBUGGER_PAUSE_AT(NEXT_ERROR, true);
return NULL;
}
@@ -140,10 +136,18 @@ bool VertexShaderCache::CompileVertexShader(VERTEXSHADER& vs, const char* pstrpr
const char *opts[] = {"-profileopts", stropt, "-O2", "-q", NULL};
CGprogram tempprog = cgCreateProgram(g_cgcontext, CG_SOURCE, pstrprogram, g_cgvProf, "main", opts);
if (!cgIsProgram(tempprog)) {
- if (s_displayCompileAlert) {
- PanicAlert("Failed to create vertex shader");
- s_displayCompileAlert = false;
- }
+ static int num_failures = 0;
+ char szTemp[MAX_PATH];
+ sprintf(szTemp, "%sbad_vs_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
+ std::ofstream file(szTemp);
+ file << pstrprogram;
+ file.close();
+
+ PanicAlert("Failed to compile vertex shader!\nThis usually happens when trying to use Dolphin with an outdated GPU or integrated GPU like the Intel GMA series.\n\nIf you're sure this is Dolphin's error anyway, post the contents of %s along with this error message at the forums.\n\nDebug info (%d):\n%s",
+ szTemp,
+ g_cgfProf,
+ cgGetLastListing(g_cgcontext));
+
cgDestroyProgram(tempprog);
ERROR_LOG(VIDEO, "Failed to load vs %s:", cgGetLastListing(g_cgcontext));
ERROR_LOG(VIDEO, "%s", pstrprogram);