diff --git a/Graphics/GraphicsEngineOpenGL/include/GLContextState.hpp b/Graphics/GraphicsEngineOpenGL/include/GLContextState.hpp index 206ffb95be..1c15a1817e 100644 --- a/Graphics/GraphicsEngineOpenGL/include/GLContextState.hpp +++ b/Graphics/GraphicsEngineOpenGL/include/GLContextState.hpp @@ -215,7 +215,6 @@ class GLContextState } }; - std::vector m_BoundTextures; std::vector m_BoundSamplers; std::vector m_BoundUniformBuffers; std::vector m_BoundImages; diff --git a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp index 38a2822101..a4252f89ba 100644 --- a/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp +++ b/Graphics/GraphicsEngineOpenGL/src/GLContextState.cpp @@ -64,7 +64,6 @@ GLContextState::GLContextState(RenderDeviceGLImpl* pDeviceGL) VERIFY_EXPR(m_Caps.MaxUniformBufferBindings > 0); } - m_BoundTextures.reserve(m_Caps.MaxCombinedTexUnits); m_BoundSamplers.reserve(32); m_BoundImages.reserve(32); m_BoundUniformBuffers.reserve(m_Caps.MaxUniformBufferBindings); @@ -102,7 +101,6 @@ void GLContextState::Invalidate() m_VAOId = -1; m_FBOId = -1; - m_BoundTextures.clear(); m_BoundSamplers.clear(); m_BoundImages.clear(); m_BoundUniformBuffers.clear(); @@ -231,12 +229,10 @@ void GLContextState::BindTexture(Int32 Index, GLenum BindTarget, const GLObjectW // Always update active texture unit SetActiveTexture(Index); - GLuint GLTexHandle = 0; - if (UpdateBoundObjectsArr(m_BoundTextures, Index, Tex, GLTexHandle)) - { - glBindTexture(BindTarget, GLTexHandle); - DEV_CHECK_GL_ERROR("Failed to bind texture to slot ", Index); - } + // Note that each bind target is tracked seprately in OpenGL, so that different + // textures can be bound to different targets of the same texture unit. + glBindTexture(BindTarget, Tex); + DEV_CHECK_GL_ERROR("Failed to bind texture to slot ", Index); } void GLContextState::BindSampler(Uint32 Index, const GLObjectWrappers::GLSamplerObj& GLSampler)