Defer OpenGL/Vulkan context announce.

This commit is contained in:
Bartosz Taudul 2018-07-11 15:00:30 +02:00
parent 26d5c4b302
commit 1f7246f6b9
2 changed files with 10 additions and 4 deletions

View File

@ -65,7 +65,6 @@ public:
GLint bits;
glGetQueryiv( GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &bits );
#ifndef TRACY_ON_DEMAND
const float period = 1.f;
Magic magic;
auto& token = s_token.ptr;
@ -78,8 +77,12 @@ public:
MemWrite( &item->gpuNewContext.period, period );
MemWrite( &item->gpuNewContext.context, m_context );
MemWrite( &item->gpuNewContext.accuracyBits, (uint8_t)bits );
tail.store( magic + 1, std::memory_order_release );
#ifdef TRACY_ON_DEMAND
s_profiler.DeferItem( *item );
#endif
tail.store( magic + 1, std::memory_order_release );
}
void Collect()

View File

@ -97,7 +97,6 @@ public:
vkQueueSubmit( queue, 1, &submitInfo, VK_NULL_HANDLE );
vkQueueWaitIdle( queue );
#ifndef TRACY_ON_DEMAND
Magic magic;
auto& token = s_token.ptr;
auto& tail = token->get_tail_index();
@ -109,8 +108,12 @@ public:
MemWrite( &item->gpuNewContext.period, period );
MemWrite( &item->gpuNewContext.context, m_context );
MemWrite( &item->gpuNewContext.accuracyBits, uint8_t( 0 ) );
tail.store( magic + 1, std::memory_order_release );
#ifdef TRACY_ON_DEMAND
s_profiler.DeferItem( *item );
#endif
tail.store( magic + 1, std::memory_order_release );
}
~VkCtx()