Silence some warnings
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user