mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-29 08:54:34 +00:00
add availability flag to vkGetQueryPoolResults (vulkan profiler)
This commit is contained in:
parent
82aecbdb31
commit
7fa2c6cfd2
@ -218,7 +218,9 @@ public:
|
|||||||
|
|
||||||
WriteInitialItem( physdev, tcpu, tgpu );
|
WriteInitialItem( physdev, tcpu, tgpu );
|
||||||
|
|
||||||
m_res = (int64_t*)tracy_malloc( sizeof( int64_t ) * m_queryCount );
|
// We need the buffer to be twice as large for availability values
|
||||||
|
size_t resSize = sizeof( int64_t ) * m_queryCount * 2;
|
||||||
|
m_res = (int64_t*)tracy_malloc( resSize );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -283,17 +285,22 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if( VK_FUNCTION_WRAPPER( vkGetQueryPoolResults( m_device, m_query, wrappedTail, cnt, sizeof( int64_t ) * m_queryCount, m_res, sizeof( int64_t ), VK_QUERY_RESULT_64_BIT ) == VK_NOT_READY ) )
|
VK_FUNCTION_WRAPPER( vkGetQueryPoolResults( m_device, m_query, wrappedTail, cnt, sizeof( int64_t ) * m_queryCount * 2, m_res, sizeof( int64_t ) * 2, VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WITH_AVAILABILITY_BIT ) );
|
||||||
{
|
|
||||||
m_oldCnt = cnt;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
for( unsigned int idx=0; idx<cnt; idx++ )
|
for( unsigned int idx=0; idx<cnt; idx++ )
|
||||||
{
|
{
|
||||||
|
int64_t avail = m_res[idx * 2 + 1];
|
||||||
|
if( avail == 0 )
|
||||||
|
{
|
||||||
|
m_oldCnt = cnt - idx;
|
||||||
|
cnt = idx;
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
auto item = Profiler::QueueSerial();
|
auto item = Profiler::QueueSerial();
|
||||||
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
MemWrite( &item->hdr.type, QueueType::GpuTime );
|
||||||
MemWrite( &item->gpuTime.gpuTime, m_res[idx] );
|
MemWrite( &item->gpuTime.gpuTime, m_res[idx * 2] );
|
||||||
MemWrite( &item->gpuTime.queryId, uint16_t( wrappedTail + idx ) );
|
MemWrite( &item->gpuTime.queryId, uint16_t( wrappedTail + idx ) );
|
||||||
MemWrite( &item->gpuTime.context, m_context );
|
MemWrite( &item->gpuTime.context, m_context );
|
||||||
Profiler::QueueSerialFinish();
|
Profiler::QueueSerialFinish();
|
||||||
|
Loading…
Reference in New Issue
Block a user