[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.
This commit is contained in:
@@ -21,9 +21,7 @@ public:
|
||||
}
|
||||
|
||||
void reset() {
|
||||
dirty = true;
|
||||
current = T::Default;
|
||||
T::Set(current);
|
||||
*this = T::Default;
|
||||
}
|
||||
|
||||
void setDirty() {
|
||||
|
||||
@@ -83,6 +83,7 @@ Painter::Painter(const TransformState& state_,
|
||||
overdrawShader.circle = std::make_unique<CircleShader>(store, Shader::Overdraw);
|
||||
|
||||
// Reset GL values
|
||||
config.setDirty();
|
||||
config.reset();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user