MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / WaitForFence

Method WaitForFence

Source/Engine/GraphicsDevice/Vulkan/GPUDeviceVulkan.cpp:2243–2260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2241}
2242
2243bool FenceManagerVulkan::WaitForFence(FenceVulkan* fence, float timeoutSeconds) const
2244{
2245 if (fence->IsSignaled)
2246 return false;
2247 PROFILE_CPU();
2248 ZoneColor(TracyWaitZoneColor);
2249 ASSERT(_usedFences.Contains(fence));
2250 uint64 timeNanoseconds = (uint64)((double)timeoutSeconds * 1000000000.0);
2251 const VkResult result = vkWaitForFences(_device->Device, 1, &fence->Handle, true, timeNanoseconds);
2252 LOG_VULKAN_RESULT(result);
2253 if (result == VK_SUCCESS)
2254 {
2255 fence->IsSignaled = true;
2256 return false;
2257 }
2258 LOG(Warning, "vkWaitForFences failed with timeout: {}s", timeoutSeconds);
2259 return true;
2260}
2261
2262void FenceManagerVulkan::ResetFence(FenceVulkan* fence) const
2263{

Callers 1

WaitMethod · 0.45

Calls 1

ContainsMethod · 0.45

Tested by

no test coverage detected