Query OpenGL time stamp accuracy.

This commit is contained in:
Bartosz Taudul 2017-11-17 14:07:42 +01:00
parent c15e692ee4
commit c251690722
2 changed files with 5 additions and 0 deletions

View File

@ -58,6 +58,9 @@ public:
glGetInteger64v( GL_TIMESTAMP, &tgpu );
int64_t tcpu = Profiler::GetTime();
GLint bits;
glGetQueryiv( GL_TIMESTAMP, GL_QUERY_COUNTER_BITS, &bits );
Magic magic;
auto& token = s_token.ptr;
auto& tail = token->get_tail_index();
@ -67,6 +70,7 @@ public:
item->gpuNewContext.gputime = tgpu;
item->gpuNewContext.thread = GetThreadHandle();
item->gpuNewContext.context = m_context;
item->gpuNewContext.accuracyBits = bits;
tail.store( magic + 1, std::memory_order_release );
}

View File

@ -140,6 +140,7 @@ struct QueueGpuNewContext
int64_t gputime;
uint64_t thread;
uint16_t context;
uint8_t accuracyBits;
};
struct QueueGpuZoneBegin