Add Tracy instrumentation for CPU and GPU in OpenGL mode. (#2417)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include <mbgl/gfx/backend_scope.hpp>
|
||||
#include <mbgl/gfx/renderer_backend.hpp>
|
||||
#include <mbgl/util/instrumentation.hpp>
|
||||
#include <mbgl/util/thread_local.hpp>
|
||||
|
||||
#include <cassert>
|
||||
@@ -22,6 +23,8 @@ BackendScope::BackendScope(RendererBackend& backend_, ScopeType scopeType_)
|
||||
nextScope(nullptr),
|
||||
backend(backend_),
|
||||
scopeType(scopeType_) {
|
||||
MLN_TRACE_FUNC();
|
||||
|
||||
if (priorScope) {
|
||||
assert(priorScope->nextScope == nullptr);
|
||||
priorScope->nextScope = this;
|
||||
@@ -34,6 +37,8 @@ BackendScope::BackendScope(RendererBackend& backend_, ScopeType scopeType_)
|
||||
}
|
||||
|
||||
BackendScope::~BackendScope() {
|
||||
MLN_TRACE_FUNC();
|
||||
|
||||
assert(nextScope == nullptr);
|
||||
deactivate();
|
||||
|
||||
@@ -48,6 +53,8 @@ BackendScope::~BackendScope() {
|
||||
}
|
||||
|
||||
void BackendScope::activate() {
|
||||
MLN_TRACE_FUNC();
|
||||
|
||||
if (scopeType == ScopeType::Explicit && !(priorScope && this->backend == priorScope->backend) &&
|
||||
!(nextScope && this->backend == nextScope->backend)) {
|
||||
// Only activate when set to Explicit and
|
||||
|
||||
Reference in New Issue
Block a user