MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / request_fence

Method request_fence

framework/fence_pool.cpp:43–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41}
42
43VkFence FencePool::request_fence()
44{
45 // Check if there is an available fence
46 if (active_fence_count < fences.size())
47 {
48 return fences[active_fence_count++];
49 }
50
51 VkFence fence{VK_NULL_HANDLE};
52
53 VkFenceCreateInfo create_info{VK_STRUCTURE_TYPE_FENCE_CREATE_INFO};
54
55 VkResult result = vkCreateFence(device.get_handle(), &create_info, nullptr, &fence);
56
57 if (result != VK_SUCCESS)
58 {
59 throw std::runtime_error("Failed to create fence.");
60 }
61
62 fences.push_back(fence);
63
64 active_fence_count++;
65
66 return fences.back();
67}
68
69VkResult FencePool::wait(uint64_t timeout) const
70{

Callers 15

load_sceneMethod · 0.45
load_modelMethod · 0.45
GuiMethod · 0.45
screenshotFunction · 0.45
submit_implMethod · 0.45
render_swapchainMethod · 0.45
on_update_ui_overlayMethod · 0.45
load_sceneMethod · 0.45
initialize_resourcesMethod · 0.45
run_gpu_cullMethod · 0.45
cpu_cullMethod · 0.45

Calls 2

sizeMethod · 0.80
get_handleMethod · 0.45

Tested by

no test coverage detected