Skip to content

Commit

Permalink
don't always return VK_INCOMPLETE with multiple effects
Browse files Browse the repository at this point in the history
  • Loading branch information
DadSchoorse committed Dec 14, 2022
1 parent a705b44 commit 2a515a9
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/basalt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,10 +375,9 @@ namespace vkBasalt
// If the images got already requested once, return them again instead of creating new images
if (pLogicalSwapchain->fakeImages.size())
{
*pCount = std::min<uint32_t>(*pCount, pLogicalSwapchain->fakeImages.size());
VkResult res = *pCount < pLogicalSwapchain->fakeImages.size() ? VK_INCOMPLETE : VK_SUCCESS;
*pCount = std::min<uint32_t>(*pCount, pLogicalSwapchain->imageCount);
std::memcpy(pSwapchainImages, pLogicalSwapchain->fakeImages.data(), sizeof(VkImage) * (*pCount));
return res;
return *pCount < pLogicalSwapchain->imageCount ? VK_INCOMPLETE : VK_SUCCESS;
}

pLogicalDevice->vkd.GetSwapchainImagesKHR(device, swapchain, &pLogicalSwapchain->imageCount, nullptr);
Expand Down Expand Up @@ -524,10 +523,9 @@ namespace vkBasalt
Logger::debug(std::to_string(i) + " written commandbuffer " + convertToString(pLogicalSwapchain->commandBuffersNoEffect[i]));
}

*pCount = std::min<uint32_t>(*pCount, pLogicalSwapchain->fakeImages.size());
VkResult res = *pCount < pLogicalSwapchain->fakeImages.size() ? VK_INCOMPLETE : VK_SUCCESS;
*pCount = std::min<uint32_t>(*pCount, pLogicalSwapchain->imageCount);
std::memcpy(pSwapchainImages, pLogicalSwapchain->fakeImages.data(), sizeof(VkImage) * (*pCount));
return res;
return *pCount < pLogicalSwapchain->imageCount ? VK_INCOMPLETE : VK_SUCCESS;
}

VKAPI_ATTR VkResult VKAPI_CALL vkBasalt_QueuePresentKHR(VkQueue queue, const VkPresentInfoKHR* pPresentInfo)
Expand Down

0 comments on commit 2a515a9

Please sign in to comment.