Don't re-type textures if they are bound to the wrong target in GL

This commit is contained in:
baldurk committed 2017-12-22 17:03:08 +00:00
1 parent 978521b81b
commit 99c2194348
1 file changed
+5 -2
@@ -224,8 +224,11 @@ bool WrappedOpenGL::Serialise_glBindTexture(SerialiserType &ser, GLenum target,
if(IsLoading(m_State))
{
m_Textures[GetResourceManager()->GetID(texture)].curType = TextureTarget(target);
m_Textures[GetResourceManager()->GetID(texture)].creationFlags |= TextureCategory::ShaderRead;
TextureData &tex = m_Textures[GetResourceManager()->GetID(texture)];
// only set texture type if we don't have one. Otherwise refuse to re-type.
if(tex.curType == eGL_NONE)
tex.curType = TextureTarget(target);
tex.creationFlags |= TextureCategory::ShaderRead;
}
}