Compare commits

...

1 Commits

Author SHA1 Message Date
Sungun Park
fe98b8be64 Fix a bug in update_state
In OpenGLContext.h, the `bindTexture` method attempts to unbind the
previous texture target when the target changes for a specific unit.
However, due to the behavior of update_state, it ends up unbinding the
new target instead.

Fix this by storing the state after functor execution, which is a more
natural logical flow.
2026-02-23 10:39:55 -08:00

View File

@@ -639,8 +639,8 @@ private:
template <typename T, typename F>
static inline void update_state(T& state, T const& expected, F functor, bool force = false) noexcept {
if (UTILS_UNLIKELY(force || state != expected)) {
state = expected;
functor();
state = expected;
}
}