1
0
forked from 0ad/0ad

Fixes crash for ARB shaders because they don't provide actual locations, triggered after c2c3a3b663.

Reported By: nwtour
This was SVN commit r26127.
This commit is contained in:
Vladislav Belov 2021-12-27 21:27:56 +00:00
parent 0837e369cf
commit 136f4621af

View File

@ -192,8 +192,6 @@ ShadowMap::ShadowMap()
{
m = new ShadowMapInternals;
m->Framebuffer = 0;
m->Texture = 0;
m->DummyTexture = 0;
m->Width = 0;
m->Height = 0;
m->QualityLevel = 0;
@ -233,8 +231,6 @@ void ShadowMap::RecreateTexture()
if (m->Framebuffer)
glDeleteFramebuffersEXT(1, &m->Framebuffer);
m->Texture = 0;
m->DummyTexture = 0;
m->Framebuffer = 0;
m->UpdateCascadesParameters();
@ -694,7 +690,7 @@ void ShadowMap::EndRender()
void ShadowMap::BindTo(const CShaderProgramPtr& shader) const
{
if (!shader->GetTextureBinding(str_shadowTex).Active())
if (!shader->GetTextureBinding(str_shadowTex).Active() || !m->Texture)
return;
shader->BindTexture(str_shadowTex, m->Texture->GetHandle());