关闭活动会导致单游戏的表面缓冲区错误

时间:2018-12-01 21:40:57

标签: android xamarin.android monogame

我有一个单人游戏,我正在从中启动一个活动以便登录。游戏运行正常。当我启动活动时,它也运行良好,并且游戏循环似乎被阻止。当我完成活动或执行OnBackPressed()时,真正的问题就来了。我收到表面缓冲区错误,屏幕变黑,但游戏循环恢复。如果我尝试在模拟器中关闭Host GPU,则该应用将在关闭活动时崩溃。

When activity opens:
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81448da0, error=EGL_BAD_MATCH


When back pressed in activity or calling Finish():
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[EGL_emulation] tid 18496: eglSurfaceAttrib(1210): error 0x3009 (EGL_BAD_MATCH)
[OpenGLRenderer] Failed to set EGL_SWAP_BEHAVIOR on surface 0x81456b00, error=EGL_BAD_MATCH
[EGL_emulation] eglMakeCurrent: 0xa4805a80: ver 2 0 (tinfo 0x82aff0b0)
[Surface] getSlotFromBufferLocked: unknown buffer: 0x0
[EGL_emulation] tid 18458: swapBuffers(531): error 0x300d (EGL_BAD_SURFACE)
[IInputConnectionWrapper] finishComposingText on inactive InputConnection
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)
[EGL_emulation] egl_window_surface_t::swapBuffers called with NULL buffer
[EGL_emulation] tid 18458: swapBuffers(498): error 0x300d (EGL_BAD_SURFACE)

Without using host gpu it crashes with:
[Surface] getSlotFromBufferLocked: unknown buffer: 0x7a697320

1 个答案:

答案 0 :(得分:0)

不幸的是,我最终不得不在单人游戏中创建自己的软键盘,因此不再启动任何android活动。