mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-15 13:41:33 +01:00
vk: convert query timestamps to ns
also, fix linux build
This commit is contained in:
parent
93a539df74
commit
a66c44a266
@ -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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user