Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling Vsync on Wayland causes Vulkan renderer to instantly crash #81949

Closed
Supreeeme opened this issue Sep 19, 2023 · 3 comments
Closed

Disabling Vsync on Wayland causes Vulkan renderer to instantly crash #81949

Supreeeme opened this issue Sep 19, 2023 · 3 comments

Comments

@Supreeeme
Copy link
Contributor

Godot version

v4.1.1.stable.arch_linux

System information

Godot v4.1.1.stable unknown - Arch Linux #1 ZEN SMP PREEMPT_DYNAMIC Wed, 13 Sep 2023 08:37:16 +0000 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 (RADV NAVI23) () - AMD Ryzen 7 5700X 8-Core Processor (16 Threads)

Issue description

Disabling vsync (using DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)) causes the Vulkan renderer to instantly crash on Wayland, with the following lines of output:

ERROR: Condition "swapchainImageCount != sp_image_count" is true. Returning: ERR_BUG
   at: _update_swap_chain (drivers/vulkan/vulkan_context.cpp:1980)
free(): double free detected in tcache 2

I'm aware that currently you essentially can't disable vsync on Wayland, but this was suggested in the OpenXR tutorial to prevent the scene from being locked to the monitor's refresh rate (which doesn't make a lot of sense since AFAIK, XR runtimes are essentially supposed to manage VSync themselves with xrBegin/EndFrame).

Steps to reproduce

Run example project in a Wayland session

Minimal reproduction project

vsync.zip

@Calinou
Copy link
Member

Calinou commented Sep 19, 2023

This is likely fixed by #80566. Please test that PR 🙂

I'm aware that currently you essentially can't disable vsync on Wayland

Wayland has a tearing extension which allows disabling V-Sync since a few years ago.

@Supreeeme
Copy link
Contributor Author

That PR works great!

@Calinou
Copy link
Member

Calinou commented Sep 20, 2023

Thanks for testing! Closing in favor of #80550 then (as this is the underlying issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants