Window contents flickering when using vulkan on wayland

Hello,
I have been working on adding wayland support to bgfx and mame. While some PRs are to be merged yet, I have discovered that the window contents are flickering when wayland is used in combination with vulkan.
Reproduction instructions are somewhat convoluted but I hope I can explain them well enough:

  1. clone bgfx_all_2 branch of my mame fork: git clone https://github.com/belegdol/mame.git && git checkout bgfx_all_2
  2. compile pong driver (any other works, but pong works without the need for any ROMs which might be problematic to acquire): make NOWERROR=1 USE_WAYLAND=1 SOURCES=src/mame/atari/pong.cpp
  3. start mame using bgfx video output, wayland videodriver and vulkan renderer: ./mame -rompath path_to_pong -window -autostretchxy -intscaley 4 -video bgfx -bgfx_backend vulkan -bgfx_debug -videodriver wayland -bgfx_screen_chains none pong

This appears to be an nvidia-specific issue as the same build of mame does not exhibit the problematic behaviour on my laptop equipped with a Ryzen 5 4500U processor.