diff --git a/src/mbgl/gl/state.hpp b/src/mbgl/gl/state.hpp index 17503cc04..77effb178 100644 --- a/src/mbgl/gl/state.hpp +++ b/src/mbgl/gl/state.hpp @@ -20,11 +20,13 @@ public: State(Args&&... args) : params(std::forward_as_tuple(::std::forward(args)...)) { } - void operator=(const typename T::Type& value) { + State& operator=(const typename T::Type& value) { if (*this != value) { setCurrentValue(value); set(std::index_sequence_for{}); } + + return *this; } bool operator==(const typename T::Type& value) const { diff --git a/src/mbgl/gl/uniform.hpp b/src/mbgl/gl/uniform.hpp index 9f752de8a..671437921 100644 --- a/src/mbgl/gl/uniform.hpp +++ b/src/mbgl/gl/uniform.hpp @@ -39,11 +39,13 @@ class UniformState { public: UniformState(UniformLocation location_ = -1) : location(location_) {} - void operator=(const Value& value) { + UniformState& operator=(const Value& value) { if (location >= 0 && (!current || *current != value)) { current = value; bindUniform(location, value); } + + return *this; } UniformLocation location;