Skip to content

Commit

Permalink
Stop when Wayland library has a fatal error (#1153)
Browse files Browse the repository at this point in the history
  • Loading branch information
mstoeckl authored Oct 8, 2024
1 parent 358babf commit d0ea039
Showing 1 changed file with 20 additions and 6 deletions.
26 changes: 20 additions & 6 deletions base/vulkanexamplebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,19 @@ void VulkanExampleBase::renderLoop()
if (benchmark.active) {
#if defined(VK_USE_PLATFORM_WAYLAND_KHR)
while (!configured)
wl_display_dispatch(display);
{
if (wl_display_dispatch(display) == -1)
break;
}
while (wl_display_prepare_read(display) != 0)
wl_display_dispatch_pending(display);
{
if (wl_display_dispatch_pending(display) == -1)
break;
}
wl_display_flush(display);
wl_display_read_events(display);
wl_display_dispatch_pending(display);
if (wl_display_dispatch_pending(display) == -1)
return;
#endif

benchmark.run([=] { render(); }, vulkanDevice->properties);
Expand Down Expand Up @@ -522,12 +529,19 @@ void VulkanExampleBase::renderLoop()
}

while (!configured)
wl_display_dispatch(display);
{
if (wl_display_dispatch(display) == -1)
break;
}
while (wl_display_prepare_read(display) != 0)
wl_display_dispatch_pending(display);
{
if (wl_display_dispatch_pending(display) == -1)
break;
}
wl_display_flush(display);
wl_display_read_events(display);
wl_display_dispatch_pending(display);
if (wl_display_dispatch_pending(display) == -1)
break;

render();
frameCounter++;
Expand Down

0 comments on commit d0ea039

Please sign in to comment.