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; 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); 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,16 +64,18 @@ void R_VkStagingFlushSync( void ) {
//gEngine.Con_Reportf(S_WARN "flushing staging buffer img count=%d\n", g_staging.images.count); //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, const VkSubmitInfo subinfo = {
.commandBufferCount = 1, .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
.pCommandBuffers = &cmdbuf, .commandBufferCount = 1,
}; .pCommandBuffers = &cmdbuf,
};
// TODO wait for previous command buffer completion. Why: we might end up writing into the same dst // TODO wait for previous command buffer completion. Why: we might end up writing into the same dst
XVK_CHECK(vkQueueSubmit(vk_core.queue, 1, &subinfo, VK_NULL_HANDLE)); XVK_CHECK(vkQueueSubmit(vk_core.queue, 1, &subinfo, VK_NULL_HANDLE));
XVK_CHECK(vkQueueWaitIdle(vk_core.queue)); XVK_CHECK(vkQueueWaitIdle(vk_core.queue));
}
g_staging.buffers.count = 0; g_staging.buffers.count = 0;
g_staging.images.count = 0; g_staging.images.count = 0;