Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make context not-current after rendering to prevent "already connecte…
…d" on ANGLE Some phones no longer have a native (E)GL implementation but use ANGLE on top of Vulkan, which is more strict about Vulkan/NativeWindow surfaces that have lingering references from an existing EGL Surface. This is especially problematic with this app that simply recreates the EGL surface every time the callback is called, e.g. in surface creation, "change", and resize: E [SurfaceView[rust.androidnativesurface/rust.androidnativesurface.MainActivity]@0#1(BLAST Consumer)1](id:5c2300000001,api:1,p:23587,c:23587) connect: already connected (cur=1 req=1) E native_window_api_connect() failed: Invalid argument (-22) D ANGLE Info:Debug.cpp:490 (insertMessage): EGL ERROR: eglPlatformCreateWindowSurface: Internal Vulkan error (-1000000001): The requested window is already connected to a VkSurfaceKHR, or to some other non-Vulkan API, in ../../src/libANGLE/renderer/vulkan/android/WindowSurfaceVkAndroid.cpp, createSurfaceVk:133. I thread '<unnamed>' panicked at src/support.rs:36:78: I called `Result::unwrap()` on an `Err` value: Error { raw_code: Some(12301), raw_os_message: None, kind: BadSurface } This is simply fixed by un-currentling the current context and the surface associated with it.
- Loading branch information