removed error suppression code from shader compilation.

With GL 2.x support the engine still had something to fall back on, with that removed it needs to abort.
This commit is contained in:
Christoph Oelckers 2014-06-23 09:26:29 +02:00
parent 1f0c69a0e9
commit e2e71e072e

View file

@ -249,14 +249,14 @@ FShader *FShaderManager::Compile (const char *ShaderName, const char *ShaderPath
shader = new FShader(ShaderName); shader = new FShader(ShaderName);
if (!shader->Load(ShaderName, "shaders/glsl/main.vp", "shaders/glsl/main.fp", ShaderPath, str)) if (!shader->Load(ShaderName, "shaders/glsl/main.vp", "shaders/glsl/main.fp", ShaderPath, str))
{ {
I_Error("Unable to load shader %s\n", ShaderName); I_FatalError("Unable to load shader %s\n", ShaderName);
} }
} }
catch(CRecoverableError &err) catch(CRecoverableError &err)
{ {
if (shader != NULL) delete shader; if (shader != NULL) delete shader;
shader = NULL; shader = NULL;
I_Error("Unable to load shader %s:\n%s\n", ShaderName, err.GetMessage()); I_FatalError("Unable to load shader %s:\n%s\n", ShaderName, err.GetMessage());
} }
return shader; return shader;
} }
@ -341,16 +341,15 @@ FShaderManager::~FShaderManager()
void FShaderManager::CompileShaders() void FShaderManager::CompileShaders()
{ {
try
{
mActiveShader = mEffectShaders[0] = mEffectShaders[1] = NULL; mActiveShader = mEffectShaders[0] = mEffectShaders[1] = NULL;
for (int i = 0; defaultshaders[i].ShaderName != NULL; i++)
for(int i=0;defaultshaders[i].ShaderName != NULL;i++)
{ {
FShader *shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc); FShader *shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc);
mTextureEffects.Push(shc); mTextureEffects.Push(shc);
} }
for (unsigned i = 0; i < usershaders.Size(); i++) for(unsigned i = 0; i < usershaders.Size(); i++)
{ {
FString name = ExtractFileBase(usershaders[i]); FString name = ExtractFileBase(usershaders[i]);
FName sfn = name; FName sfn = name;
@ -359,7 +358,7 @@ void FShaderManager::CompileShaders()
mTextureEffects.Push(shc); mTextureEffects.Push(shc);
} }
for (int i = 0; i < MAX_EFFECTS; i++) for(int i=0;i<MAX_EFFECTS;i++)
{ {
FShader *eff = new FShader(effectshaders[i].ShaderName); FShader *eff = new FShader(effectshaders[i].ShaderName);
if (!eff->Load(effectshaders[i].ShaderName, effectshaders[i].vp, effectshaders[i].fp1, if (!eff->Load(effectshaders[i].ShaderName, effectshaders[i].vp, effectshaders[i].fp1,
@ -369,15 +368,6 @@ void FShaderManager::CompileShaders()
} }
else mEffectShaders[i] = eff; else mEffectShaders[i] = eff;
} }
}
catch (CRecoverableError &err)
{
// If shader compilation failed we can still run the fixed function mode so do that instead of aborting.
Printf("%s\n", err.GetMessage());
Printf(PRINT_HIGH, "Failed to compile shaders. Reverting to fixed function mode\n");
gl.glslversion = 0.0;
gl.flags &= ~RFL_BUFFER_STORAGE;
}
} }
//========================================================================== //==========================================================================
@ -458,6 +448,9 @@ void FShaderManager::SetWarpSpeed(unsigned int eff, float speed)
} }
} }
//==========================================================================
//
//
// //
//========================================================================== //==========================================================================