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

Method ThreadFunc

layers/state_tracker/queue_state.cpp:330–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328}
329
330void vvl::Queue::ThreadFunc() {
331 VVL_TracySetThreadName(__FUNCTION__);
332
333 QueueSubmission* submission = nullptr;
334
335 // Roll this queue forward, one submission at a time.
336 while (true) {
337 submission = NextSubmission();
338 if (submission == nullptr) {
339 break;
340 }
341 Retire(*submission);
342 // wake up anyone waiting for this submission to be retired
343 {
344 std::shared_ptr<Fence> fence;
345 std::promise<void> completed;
346 {
347 auto guard = Lock();
348 fence = std::move(submission->fence);
349 completed = std::move(submission->completed);
350 submissions_.pop_front();
351 }
352
353 // Retire the fence after removing the submission from the queue (submissions_.pop_front).
354 // This ensures the completed QueueSubmission is not visible after vkWaitForFences
355 if (fence) {
356 fence->Retire();
357 }
358
359 // Unblock waiting QueueWaitIdle/DeviceWaitIdle
360 completed.set_value();
361 }
362 }
363}

Callers

nothing calls this directly

Calls 3

set_valueMethod · 0.80
pop_frontMethod · 0.45
RetireMethod · 0.45

Tested by

no test coverage detected