Gtk/Vulkan: Handle failure to acquire swapchain image.

This commit is contained in:
BearOso 2023-02-23 17:45:37 -06:00
parent 39e21410d8
commit 6ae1a4478e
1 changed files with 14 additions and 10 deletions

View File

@ -119,27 +119,31 @@ void S9xVulkanDisplayDriver::update(uint16_t *buffer, int width, int height, int
return;
auto viewport = S9xApplyAspect(width, height, current_width, current_height);
bool retval = false;
if (shaderchain)
{
shaderchain->do_frame_without_swap((uint8_t *)buffer, width, height, stride_in_pixels << 1, vk::Format::eR5G6B5UnormPack16, viewport.x, viewport.y, viewport.w, viewport.h);
retval = shaderchain->do_frame_without_swap((uint8_t *)buffer, width, height, stride_in_pixels << 1, vk::Format::eR5G6B5UnormPack16, viewport.x, viewport.y, viewport.w, viewport.h);
}
else if (simple_output)
{
simple_output->set_filter(Settings.BilinearFilter);
simple_output->do_frame_without_swap((uint8_t *)buffer, width, height, stride_in_pixels << 1, viewport.x, viewport.y, viewport.w, viewport.h);
retval = simple_output->do_frame_without_swap((uint8_t *)buffer, width, height, stride_in_pixels << 1, viewport.x, viewport.y, viewport.w, viewport.h);
}
if (Settings.SkipFrames == THROTTLE_TIMER || Settings.SkipFrames == THROTTLE_TIMER_FRAMESKIP)
if (retval)
{
throttle.set_frame_rate(Settings.PAL ? PAL_PROGRESSIVE_FRAME_RATE : NTSC_PROGRESSIVE_FRAME_RATE);
throttle.wait_for_frame_and_rebase_time();
if (Settings.SkipFrames == THROTTLE_TIMER || Settings.SkipFrames == THROTTLE_TIMER_FRAMESKIP)
{
throttle.set_frame_rate(Settings.PAL ? PAL_PROGRESSIVE_FRAME_RATE : NTSC_PROGRESSIVE_FRAME_RATE);
throttle.wait_for_frame_and_rebase_time();
}
context->swapchain->swap();
if (gui_config->reduce_input_lag)
context->wait_idle();
}
context->swapchain->swap();
if (gui_config->reduce_input_lag)
context->wait_idle();
}
int S9xVulkanDisplayDriver::query_availability()