You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
bit-garden opened this issue
Apr 19, 2022
· 3 comments
Labels
C-BugAn unexpected or incorrect behaviorC-StartupA crash that occurs when first attempting to run a Bevy appO-AndroidSpecific to the Android mobile operating systemP-CrashA sudden unexpected crash
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR means that window already has a swapchain. A window can only have one swapchain (counting even other API's swapchains like OpenGL and DXGI).
If you recreate the swapchain, you must either first destroy the old swapchain, or you must provide it to the oldSwapchain parameter.
The text was updated successfully, but these errors were encountered:
This was an issue that I also came across while working on #4913
I'm fairly sure the issue comes from the transient surface that's created by Bevy while it's looking for a wgpu adapter that's compatible with a given surface. Instead of Bevy passing in an existing surface that's associated with any primary window that's created it creates a new surface. On Android that leads to this error.
I tend to think that this design isn't ideal for any platform, since it doesn't conceptually ensure that Bevy finds an adapter that's compatible with the real surface that it will be rendering to. It's also possible for surfaces allocations to be a somewhat limited resource on some platforms e.g. if GPUs have constraints on what types of memory they can render to - so I tend to think that this design should ideally be changed for all platforms to aim to refer to any existing primary window instead of creating an ad hoc surface.
For reference; here's a patch I made when testing the deferred render init work on Android that avoids creating this extra surface: rib@1ea04f0
C-BugAn unexpected or incorrect behaviorC-StartupA crash that occurs when first attempting to run a Bevy appO-AndroidSpecific to the Android mobile operating systemP-CrashA sudden unexpected crash
Panic at 'AndroidSurface failed: ERROR_NATIVE_WINDOW_IN_USE_KHR'.
Bevy version
Dev 0.8.0
Operating system & version
Win 10, targeting Android
Example code
Modified Cargo.toml
Logcat
More information
https://stackoverflow.com/questions/68725535/what-does-vk-error-native-window-in-use-khr-mean
The text was updated successfully, but these errors were encountered: