- at least for Intel GMA we need shaders without 'discard' to render non-transparent stuff. The performance penalty is rather hefty here.

This commit is contained in:
Christoph Oelckers 2014-08-02 21:06:34 +02:00
commit a63871d170
3 changed files with 22 additions and 4 deletions

View file

@ -387,6 +387,8 @@ void FShaderManager::CompileShaders()
{
mActiveShader = NULL;
mTextureEffects.Clear();
mTextureEffectsNAT.Clear();
for (int i = 0; i < MAX_EFFECTS; i++)
{
mEffectShaders[i] = NULL;
@ -396,6 +398,11 @@ void FShaderManager::CompileShaders()
{
FShader *shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc, true);
mTextureEffects.Push(shc);
if (i <= 3)
{
FShader *shc = Compile(defaultshaders[i].ShaderName, defaultshaders[i].gettexelfunc, false);
mTextureEffectsNAT.Push(shc);
}
}
for(unsigned i = 0; i < usershaders.Size(); i++)
@ -430,6 +437,10 @@ void FShaderManager::Clean()
glUseProgram(0);
mActiveShader = NULL;
for (unsigned int i = 0; i < mTextureEffectsNAT.Size(); i++)
{
if (mTextureEffectsNAT[i] != NULL) delete mTextureEffectsNAT[i];
}
for (unsigned int i = 0; i < mTextureEffects.Size(); i++)
{
if (mTextureEffects[i] != NULL) delete mTextureEffects[i];
@ -440,6 +451,7 @@ void FShaderManager::Clean()
mEffectShaders[i] = NULL;
}
mTextureEffects.Clear();
mTextureEffectsNAT.Clear();
}
//==========================================================================
@ -504,10 +516,12 @@ EXTERN_CVAR(Int, gl_fuzztype)
void FShaderManager::ApplyMatrices(VSMatrix *proj, VSMatrix *view)
{
for (int i = 0; i <= 4; i++)
for (int i = 0; i < 4; i++)
{
mTextureEffects[i]->ApplyMatrices(proj, view);
mTextureEffectsNAT[i]->ApplyMatrices(proj, view);
}
mTextureEffects[4]->ApplyMatrices(proj, view);
if (gl_fuzztype != 0)
{
mTextureEffects[4+gl_fuzztype]->ApplyMatrices(proj, view);