summaryrefslogtreecommitdiff
path: root/src/mbgl/shader/uniform.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mbgl/shader/uniform.hpp')
-rw-r--r--src/mbgl/shader/uniform.hpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mbgl/shader/uniform.hpp b/src/mbgl/shader/uniform.hpp
index d2a248c609..55646f7d87 100644
--- a/src/mbgl/shader/uniform.hpp
+++ b/src/mbgl/shader/uniform.hpp
@@ -36,10 +36,16 @@ public:
location = MBGL_CHECK_ERROR(glGetUniformLocation(shader.program, name));
}
- void operator=(const T& t) {
- if (current != t) {
- current = t;
- bind(t);
+ void operator=(const std::array<double, C*R>& t) {
+ bool dirty = false;
+ for (unsigned int i = 0; i < C*R; i++) {
+ if (current[i] != t[i]) {
+ current[i] = t[i];
+ dirty = true;
+ }
+ }
+ if (dirty) {
+ bind(current);
}
}