mirror of
https://github.com/w23/xash3d-fwgs
synced 2024-12-14 21:20:26 +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;
|
||||
|
||||
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);
|
||||
|
||||
const VkSubmitInfo subinfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
.commandBufferCount = 1,
|
||||
.pCommandBuffers = &cmdbuf,
|
||||
};
|
||||
{
|
||||
const VkSubmitInfo subinfo = {
|
||||
.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO,
|
||||
.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(vkQueueWaitIdle(vk_core.queue));
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user