Skip to content

Commit eca16be

Browse files
committed
use GL_QUERY_RESULT_NO_WAIT for non-blocking GPU queries
This should be a little bit faster than the current implementation with GL_QUERY_RESULT_AVAILABLE and GL_QUERY_RESULT.
1 parent 5c75032 commit eca16be

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

public/tracy/TracyOpenGL.hpp

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,9 @@ class GpuCtx
155155

156156
while( m_tail != m_head )
157157
{
158-
GLint available;
159-
glGetQueryObjectiv( m_query[m_tail], GL_QUERY_RESULT_AVAILABLE, &available );
160-
if( !available ) return;
161-
162-
uint64_t time;
163-
glGetQueryObjectui64v( m_query[m_tail], GL_QUERY_RESULT, &time );
158+
uint64_t time = ~0ull;
159+
glGetQueryObjectui64v( m_query[m_tail], GL_QUERY_RESULT_NO_WAIT, &time );
160+
if (time == ~0ull) return;
164161

165162
TracyLfqPrepare( QueueType::GpuTime );
166163
MemWrite( &item->gpuTime.gpuTime, (int64_t)time );

0 commit comments

Comments
 (0)