Skip to content

Commit c7c98de

Browse files
committed
layers: Add link to swapchain reuse article
1 parent ccbb66b commit c7c98de

File tree

1 file changed

+7
-19
lines changed

1 file changed

+7
-19
lines changed

layers/core_checks/cc_synchronization.cpp

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ static std::string GetSemaphoreInUseBySwapchainMessage(const vvl::Semaphore::Swa
246246
marked_history_index = (history_length - 1) - (swapchain.acquire_count - swapchain_info.acquire_counter_value);
247247
}
248248
// Print acquire history
249-
ss << "Here are the most recently acquired image indices: ";
249+
ss << "Most recently acquired image indices: ";
250250
for (uint32_t i = 0; i < print_count; i++) {
251251
uint32_t history_index = first_history_index + i;
252252
uint32_t acquired_image_index = swapchain.GetAcquiredImageIndexFromHistory(history_index);
@@ -261,7 +261,7 @@ static std::string GetSemaphoreInUseBySwapchainMessage(const vvl::Semaphore::Swa
261261
ss << ", ";
262262
}
263263
}
264-
ss << ".\n(brackets mark the last use of " << semaphore_str << " in a presentation operation)\n";
264+
ss << ".\n(Brackets mark the last use of " << semaphore_str << " in a presentation operation.)\n";
265265
// Describe problem details
266266
ss << "Swapchain image " << swapchain_info.image_index << " was presented but was ";
267267
if (swapchain_fence_supported) {
@@ -277,29 +277,17 @@ static std::string GetSemaphoreInUseBySwapchainMessage(const vvl::Semaphore::Swa
277277
<< swapchain.GetAcquiredImageIndexFromHistory(history_length - 1);
278278
}
279279
ss << ".\n";
280-
// Additional details
281-
ss << "Vulkan insight: One solution is to assign each image its own semaphore.";
282-
if (print_count >= 2 && swapchain.GetAcquiredImageIndexFromHistory(history_length - 2) ==
283-
swapchain.GetAcquiredImageIndexFromHistory(history_length - 1)) {
284-
ss << " This also handles the case where vkAcquireNextImageKHR returns the same index twice in a "
285-
"row.";
286-
}
287280
}
288281
} else { // Multiple swapchains use case. Describe problem without additional swapchain data
289282
ss << "(" << semaphore_str << ") is being signaled by " << queue_str
290283
<< ", but it may still be in use by the swapchain since the corresponding swapchain image has not been "
291284
"re-acquired.\n";
292-
293-
ss << "Vulkan insight:";
294285
}
295-
// Shared additional details.
296-
ss << " Here are some common methods to ensure that a semaphore passed to vkQueuePresentKHR is not in use and can be "
297-
"safely reused:\n"
298-
"\ta) Use a separate semaphore per swapchain image. Index these semaphores using the index of the "
299-
"acquired image.\n"
300-
"\tb) Consider the VK_KHR_swapchain_maintenance1 extension. It allows using a VkFence with the "
301-
"presentation operation.";
302-
286+
ss << "Vulkan insight: See https://docs.vulkan.org/guide/latest/swapchain_semaphore_reuse.html for details on swapchain "
287+
"semaphore reuse. Examples of possible approaches:\n"
288+
" a) Use a separate semaphore per swapchain image. Index these semaphores using the index of the acquired image.\n"
289+
" b) Consider the VK_KHR_swapchain_maintenance1 extension. It allows using a VkFence with the presentation "
290+
"operation.\n";
303291
return ss.str();
304292
}
305293

0 commit comments

Comments
 (0)