Silence some warnings

This commit is contained in:
Georg Hagen
2024-07-23 22:10:33 +02:00
parent 02ff22d193
commit 2e51457602
2 changed files with 17 additions and 5 deletions

View File

@@ -50,13 +50,25 @@ namespace OpenVulkano::Vulkan
{
currentSemaphoreId = (currentSemaphoreId + 1) % imageAvailableSemaphores.size();
const auto resultValue = device->device.acquireNextImageKHR(swapChain, UINT64_MAX, imageAvailableSemaphores[currentSemaphoreId], fence);
const vk::Result result = resultValue.result;
if (result != vk::Result::eSuccess && result != vk::Result::eSuboptimalKHR) throw std::error_code(result);
vk::Result result = resultValue.result;
if (result != vk::Result::eSuccess && result != vk::Result::eSuboptimalKHR) [[unlikely]]
{
Logger::RENDER->error("Failed to acquire next swapchain image: {}", vk::to_string(result));
throw std::error_code(result);
}
SetCurrentFrameId(resultValue.value);
vk::Fence submitFence = GetCurrentSubmitFence();
device->device.waitForFences(1, &submitFence, true, -1);
device->device.resetFences(1, &submitFence);
result = device->device.waitForFences(1, &submitFence, true, -1);
if (result != vk::Result::eSuccess) [[unlikely]]
{
Logger::RENDER->error("Failed to wait for fence: {}", vk::to_string(result));
}
result = device->device.resetFences(1, &submitFence);
if (result != vk::Result::eSuccess) [[unlikely]]
{
Logger::RENDER->error("Failed to reset fence: {}", vk::to_string(result));
}
return currentFrameBufferId;
}