Skip to content

Commit f82c351

Browse files
authored
Stateless texture unit binding (#577)
Tested stateless texture unit binding... and it works well!
1 parent 3bc135f commit f82c351

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Sources/Overload/OvRendering/src/OvRendering/HAL/OpenGL/GLTextureHandle.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ void OvRendering::HAL::GLTextureHandle::Bind(std::optional<uint32_t> p_slot) con
2929
{
3030
if (p_slot.has_value())
3131
{
32-
glActiveTexture(GL_TEXTURE0 + p_slot.value());
32+
glBindTextureUnit(p_slot.value(), m_context.id);
33+
}
34+
else
35+
{
36+
glBindTexture(m_context.type, m_context.id);
3337
}
34-
35-
glBindTexture(m_context.type, m_context.id);
3638
}
3739

3840
template<>

0 commit comments

Comments
 (0)