summaryrefslogtreecommitdiff
path: root/include/mbgl/gl
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2016-07-07 16:29:34 +0200
committerKonstantin Käfer <mail@kkaefer.com>2016-07-07 16:29:34 +0200
commit2e10c0a8660af9cdf6ff897aaa39e15fe62c6582 (patch)
tree92ad442bd0b54fcb16317e77c5a3a45213a16145 /include/mbgl/gl
parentab1face71f62752d49a0d25f8bc22fe142c7cdee (diff)
downloadqtlocation-mapboxgl-2e10c0a8660af9cdf6ff897aaa39e15fe62c6582.tar.gz
[core] don't force GL state to be set when calling .reset()
We are using Value::reset() to change a piece of GL state to its default value. However, the current implementation always executes the GL call, even if our state tracking system knows that it's already at that value. The new implementation of Value::reset() now respects that, resulting in a lot fewer GL calls.
Diffstat (limited to 'include/mbgl/gl')
-rw-r--r--include/mbgl/gl/gl_values.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/mbgl/gl/gl_values.hpp b/include/mbgl/gl/gl_values.hpp
index 1e05984fbc..b15ef18f48 100644
--- a/include/mbgl/gl/gl_values.hpp
+++ b/include/mbgl/gl/gl_values.hpp
@@ -140,6 +140,10 @@ struct StencilOp {
}
};
+constexpr bool operator!=(const StencilOp::Type& a, const StencilOp::Type& b) {
+ return a.sfail != b.sfail || a.dpfail != b.dpfail || a.dppass != b.dppass;
+}
+
struct DepthRange {
struct Type { GLfloat near, far; };
static const Type Default;