Race condition fix

This commit is contained in:
Henrik Rydgård 2023-08-08 14:00:58 +02:00
parent 8fec4fb02f
commit 652cc6cd65
2 changed files with 2 additions and 1 deletions

View file

@ -113,6 +113,8 @@ VkResult FrameData::QueuePresent(VulkanContext *vulkan, FrameDataShared &shared)
// Can't move these into the if.
VkPresentIdKHR presentID{ VK_STRUCTURE_TYPE_PRESENT_ID_KHR };
VkPresentTimesInfoGOOGLE presentGOOGLE{ VK_STRUCTURE_TYPE_PRESENT_TIMES_INFO_GOOGLE };
uint64_t frameId = this->frameId;
VkPresentTimeGOOGLE presentTimeGOOGLE{ (uint32_t)frameId, 0 }; // it's ok to truncate this. it'll wrap around and work (if we ever reach 4 billion frames..)
if (vulkan->Extensions().KHR_present_id && vulkan->GetDeviceFeatures().enabled.presentId.presentId) {
presentID.pPresentIds = &frameId;

View file

@ -585,7 +585,6 @@ void VulkanRenderManager::PollPresentTiming() {
}
}
void VulkanRenderManager::BeginFrame(bool enableProfiling, bool enableLogProfiler) {
double frameBeginTime = time_now_d()
VLOG("BeginFrame");