mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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
This commit is contained in:
@ -223,13 +223,7 @@ FRAGMENTSHADER* PixelShaderCache::SetShader(DSTALPHA_MODE dstAlphaMode, u32 comp
|
||||
}
|
||||
#endif
|
||||
|
||||
// printf("Compiling pixel shader. size = %i\n", strlen(code));
|
||||
if (!code || !CompilePixelShader(newentry.shader, code)) {
|
||||
ERROR_LOG(VIDEO, "failed to create pixel shader");
|
||||
static int counter = 0;
|
||||
char szTemp[MAX_PATH];
|
||||
sprintf(szTemp, "%sBADps_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), counter++);
|
||||
SaveData(szTemp, code);
|
||||
GFX_DEBUGGER_PAUSE_AT(NEXT_ERROR, true);
|
||||
return NULL;
|
||||
}
|
||||
@ -258,13 +252,19 @@ bool PixelShaderCache::CompilePixelShader(FRAGMENTSHADER& ps, const char* pstrpr
|
||||
if (!cgIsProgram(tempprog))
|
||||
{
|
||||
cgDestroyProgram(tempprog);
|
||||
if (g_ActiveConfig.bShowShaderErrors)
|
||||
{
|
||||
std::string message = cgGetLastListing(g_cgcontext);
|
||||
message += "\n\n";
|
||||
message += pstrprogram;
|
||||
CriticalAlertT("Failed to compile ps %s", message.c_str());
|
||||
}
|
||||
|
||||
static int num_failures = 0;
|
||||
char szTemp[MAX_PATH];
|
||||
sprintf(szTemp, "%sbad_ps_%04i.txt", File::GetUserPath(D_DUMP_IDX).c_str(), num_failures++);
|
||||
std::ofstream file(szTemp);
|
||||
file << pstrprogram;
|
||||
file.close();
|
||||
|
||||
PanicAlert("Failed to compile pixel 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));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -55,8 +55,6 @@ class VertexShaderCache
|
||||
|
||||
static VSCache vshaders;
|
||||
|
||||
static bool s_displayCompileAlert;
|
||||
|
||||
static GLuint CurrentShader;
|
||||
static bool ShaderEnabled;
|
||||
|
||||
|
Reference in New Issue
Block a user