MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-ValidationLayers / OnTimelineWait

Method OnTimelineWait

layers/sync/sync_submit.cpp:121–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119}
120
121std::optional<SignalInfo> SignalsUpdate::OnTimelineWait(VkSemaphore semaphore, uint64_t wait_value) {
122 std::optional<SignalInfo> resolving_signal;
123 // Search for the smallest signal value that resolves the wait.
124 // At first check registered signals (they have smaller values)
125 if (const std::vector<SignalInfo>* signals = vvl::Find(sync_validator_.timeline_signals_, semaphore)) {
126 for (auto& signal : *signals) {
127 if (wait_value <= signal.timeline_value) {
128 resolving_signal.emplace(signal);
129 break;
130 }
131 }
132 }
133 // then check the pending signals
134 if (!resolving_signal.has_value()) {
135 if (const std::vector<SignalInfo>* pending_signals = vvl::Find(timeline_signals, semaphore)) {
136 for (auto& signal : *pending_signals) {
137 if (wait_value <= signal.timeline_value) {
138 resolving_signal.emplace(signal);
139 break;
140 }
141 }
142 }
143 }
144 // Register request to remove older signals
145 if (resolving_signal.has_value()) {
146 RemoveTimelineSignalsRequest request;
147 request.semaphore = semaphore;
148 request.signal_threshold_value = resolving_signal->timeline_value;
149 request.queue = resolving_signal->first_scope.queue;
150 remove_timeline_signals_requests.emplace_back(request);
151 }
152 return resolving_signal; // empty result if it is a wait-before-signal
153}
154
155void SwapchainSubState::RecordPresentedImage(PresentedImage&& presented_image) {
156 // All presented images are stored within the swapchain until the are reaquired.

Callers 2

ResolveSubmitWaitsMethod · 0.80

Calls 4

has_valueMethod · 0.80
emplace_backMethod · 0.80
FindFunction · 0.50
emplaceMethod · 0.45

Tested by

no test coverage detected