Browse Source

Merge branch 'master' into 12.0-development

Alex Szpakowski 5 years ago
parent
commit
c5b6cc3228
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/modules/graphics/opengl/OpenGL.cpp

+ 5 - 0
src/modules/graphics/opengl/OpenGL.cpp

@@ -1004,6 +1004,11 @@ void OpenGL::bindTextureToUnit(TextureType target, GLuint texture, int textureun
 		else
 			state.curTextureUnit = textureunit;
 	}
+	else if (!restoreprev && textureunit != state.curTextureUnit)
+	{
+		glActiveTexture(GL_TEXTURE0 + textureunit);
+		state.curTextureUnit = textureunit;
+	}
 }
 
 void OpenGL::bindTextureToUnit(Texture *texture, int textureunit, bool restoreprev)