1
0
mirror of https://github.com/wolfpld/tracy.git synced 2025-03-20 07:40:02 +08:00

Disallow direct access to s_token.

This commit is contained in:
Bartosz Taudul
2019-02-19 18:27:00 +01:00
parent 44753dd4ac
commit d865d1cc87
8 changed files with 66 additions and 68 deletions
+5 -5
View File
@@ -96,7 +96,7 @@ public:
const float period = 1.f;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::GpuNewContext );
@@ -150,7 +150,7 @@ public:
start %= QueryCount;
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
while( m_tail != start )
@@ -211,7 +211,7 @@ public:
glQueryCounter( s_gpuCtx.ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::GpuZoneBegin );
@@ -237,7 +237,7 @@ public:
const auto thread = GetThreadHandle();
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::GpuZoneBeginCallstack );
@@ -260,7 +260,7 @@ public:
glQueryCounter( s_gpuCtx.ptr->TranslateOpenGlQueryId( queryId ), GL_TIMESTAMP );
Magic magic;
auto& token = s_token.ptr;
auto token = GetToken();
auto& tail = token->get_tail_index();
auto item = token->enqueue_begin<tracy::moodycamel::CanAlloc>( magic );
MemWrite( &item->hdr.type, QueueType::GpuZoneEnd );