vk: convert query timestamps to ns

also, fix linux build
This commit is contained in:
Ivan Avdeev 2023-03-18 13:28:14 -07:00 committed by Ivan Avdeev
parent 93a539df74
commit a66c44a266
2 changed files with 14 additions and 8 deletions

View File

@ -40,4 +40,8 @@ void R_VkQueryPoolGetFrameResults( vk_query_pool_t *pool ) {
return;
vkGetQueryPoolResults(vk_core.device, pool->pool, 0, pool->used, pool->used * sizeof(uint64_t), pool->results, sizeof(uint64_t), VK_QUERY_RESULT_64_BIT | VK_QUERY_RESULT_WAIT_BIT);
for (int i = 0; i < pool->used; ++i) {
pool->results[i] *= vk_core.physical_device.properties.limits.timestampPeriod;
}
}

View File

@ -64,6 +64,7 @@ void R_VkStagingFlushSync( void ) {
//gEngine.Con_Reportf(S_WARN "flushing staging buffer img count=%d\n", g_staging.images.count);
{
const VkSubmitInfo subinfo = {
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.commandBufferCount = 1,
@ -74,6 +75,7 @@ void R_VkStagingFlushSync( void ) {
XVK_CHECK(vkQueueSubmit(vk_core.queue, 1, &subinfo, VK_NULL_HANDLE));
XVK_CHECK(vkQueueWaitIdle(vk_core.queue));
}
g_staging.buffers.count = 0;
g_staging.images.count = 0;