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,17 +119,20 @@ void S9xVulkanDisplayDriver::update(uint16_t *buffer, int width, int height, int
return; return;
auto viewport = S9xApplyAspect(width, height, current_width, current_height); auto viewport = S9xApplyAspect(width, height, current_width, current_height);
bool retval = false;
if (shaderchain) 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) else if (simple_output)
{ {
simple_output->set_filter(Settings.BilinearFilter); 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 (retval)
{
if (Settings.SkipFrames == THROTTLE_TIMER || Settings.SkipFrames == THROTTLE_TIMER_FRAMESKIP) 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.set_frame_rate(Settings.PAL ? PAL_PROGRESSIVE_FRAME_RATE : NTSC_PROGRESSIVE_FRAME_RATE);
@ -140,6 +143,7 @@ void S9xVulkanDisplayDriver::update(uint16_t *buffer, int width, int height, int
if (gui_config->reduce_input_lag) if (gui_config->reduce_input_lag)
context->wait_idle(); context->wait_idle();
}
} }
int S9xVulkanDisplayDriver::query_availability() int S9xVulkanDisplayDriver::query_availability()