Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion runtime/shims/dxgi_swapchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,16 @@ class VulkanSwapchain {
ci.oldSwapchain = swapchain_;

VkSwapchainKHR next = VK_NULL_HANDLE;
if (observe(fn_.create_swapchain(device_, &ci, nullptr, &next), "vkCreateSwapchainKHR (DXGI)") != VK_SUCCESS) {
if (const VkResult created = observe(fn_.create_swapchain(device_, &ci, nullptr, &next),
"vkCreateSwapchainKHR (DXGI)");
created != VK_SUCCESS) {
// observe() speaks only for a lost device, so a swapchain the surface refuses used to vanish here and
// resurface later as "present failed", which names the symptom rather than the cause. Name the request.
std::fprintf(stderr,
"[rt] d3d12: vkCreateSwapchainKHR failed (VkResult %d): format %d, colour space %d, %ux%u, "
"present mode %d, images %u, composite alpha %d\n",
int(created), int(ci.imageFormat), int(ci.imageColorSpace), ci.imageExtent.width,
ci.imageExtent.height, int(ci.presentMode), ci.minImageCount, int(ci.compositeAlpha));
// oldSwapchain is retired even when the call fails: it can neither present nor be passed as
// oldSwapchain again (VUID-VkSwapchainCreateInfoKHR-oldSwapchain-01933). Drop it and its buffers, as a
// failed ResizeBuffers leaves the host's swap chain with none.
Expand Down
Loading