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

[Android] Assert fails in internal Unreal Engine OpenGL ES code #12

Open
N7Alpha opened this issue Feb 9, 2022 · 0 comments
Open

[Android] Assert fails in internal Unreal Engine OpenGL ES code #12

N7Alpha opened this issue Feb 9, 2022 · 0 comments

Comments

@N7Alpha
Copy link
Owner

N7Alpha commented Feb 9, 2022

D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: === Critical error: ===
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: 
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: Assertion failed: ContextType >= 0 [File:D:/Build/++UE4/Sync/Engine/Source/Runtime/OpenGLDrv/Private/OpenGLDevice.cpp] [Line: 159] 
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: 
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8DE8FCEC libUE4.so(0x0000000009686CEC)!FDebug::CheckVerifyFailedImpl(char const*, char const*, int, char16_t const*, ...)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A92C27B90 libUE4.so(0x000000000E41EB90)!FOpenGLDynamicRHI::GetContextStateForCurrentContext(bool)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A92CD6420 libUE4.so(0x000000000E4CD420)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A92C65D54 libUE4.so(0x000000000E45CD54)!RunOnGLRenderContextThread(TUniqueFunction<void ()>, bool)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A92C84A2C libUE4.so(0x000000000E47BA2C)!FOpenGLDynamicRHI::RHIUpdateTexture2D(FRHITexture2D*, unsigned int, FUpdateTextureRegion2D const&, unsigned int, unsigned char const*)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9F39F0 libUE4.so(0x00000000081EA9F0)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9F337C libUE4.so(0x00000000081EA37C)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9E3904 libUE4.so(0x00000000081DA904)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9E139C libUE4.so(0x00000000081D839C)!LibretroContext::core_video_refresh(void const*, unsigned int, unsigned int, unsigned int)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8CA12CDC libUE4.so(0x0000000008209CDC)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8CA129B0 libUE4.so(0x00000000082099B0)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9CF7F4 libUE4.so(0x00000000081C67F4)!UE4Function_Private::TFunctionRefBase<UE4Function_Private::TFunctionStorage<true>, void (void const*, unsigned int, unsigned int, unsigned long)>::operator()(void const*, unsigned int, unsigned int, unsigned long) const  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9CFBBC libUE4.so(0x00000000081C6BBC)!func_wrap_video_refresh1(void const*, unsigned int, unsigned int, unsigned long)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A82E5E8F0 5C54690809C44490B44B60F71570C51D.so(0x00000000000478F0)!retro_run()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8CA18264 libUE4.so(0x000000000820F264)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8CA16230 libUE4.so(0x000000000820D230)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9CA5E4 libUE4.so(0x00000000081C15E4)!UE4Function_Private::TFunctionRefBase<UE4Function_Private::TFunctionStorage<true>, void ()>::operator()() const  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8C9CA594 libUE4.so(0x00000000081C1594)!FLambdaRunnable::Run()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8DD54E74 libUE4.so(0x000000000954BE74)!FRunnableThreadPThread::Run()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007A8DC31D94 libUE4.so(0x0000000009428D94)!FRunnableThreadPThread::_ThreadProc(void*)  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007B3C775F48 libc.so(0x0000000000092F48)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: [Callstack] 0x0000007B3C706C88 libc.so(0x0000000000023C88)![Unknown]()  []
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: 
D/UE4     : [2022.02.06-19.29.00:669][  0]LogAndroid: Error: 

I'll fix this probably just documenting it here.

This crash happens immediately on loading an app with a OpenGL ES hardware accelerated core somewhat rarely like 1 in 10 startups. I suspect EGL might not be entirely threadsafe on Android, or Unreal does some jank where it probes threads and thinks the context I made is one used multithreaded rendering. The surrounding code in the assert suggests it could be something like that. I think if I just block in the Libretro Core thread's until Unreal Engine finishes loading all of its OpenGL ES context's that would probably workaround the issue in either case.

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

No branches or pull requests

1 participant