Fix returning null in nativeEglGetCurrentContext

Still, nothing changed, virglrenderer seems to face a deadlock...

thread #49, name = 'Client thread'
frame #0: 0x000071c448382187 libc.so`read + 7
frame #1: 0x000071c380338bf0 libOSMesa_8.so`virgl_block_read(fd=215, buf=0x000071c39ec81c98, size=8) at virgl_vtest_socket.c:61:13
frame #2: 0x000071c38033872b libOSMesa_8.so`virgl_vtest_negotiate_version(vws=0x000071c382e155c0) at virgl_vtest_socket.c:164:10
frame #3: 0x000071c380338576 libOSMesa_8.so`virgl_vtest_connect(vws=0x000071c382e155c0) at virgl_vtest_socket.c:220:28
frame #4: 0x000071c380335b60 libOSMesa_8.so`virgl_vtest_winsys_wrap(sws=0x000071c3899dea70) at virgl_vtest_winsys.c:662:4
frame #5: 0x000071c37f7e5305 libOSMesa_8.so`sw_screen_create_named(winsys=0x000071c3899dea70, driver="virpipe") at inline_sw_helper.h:57:13
frame #6: 0x000071c37f7e5246 libOSMesa_8.so`sw_screen_create_vk(winsys=0x000071c3899dea70, sw_vk=false) at inline_sw_helper.h:118:36
frame #7: 0x000071c37f7e5137 libOSMesa_8.so`sw_screen_create(winsys=0x000071c3899dea70) at inline_sw_helper.h:131:11
frame #8: 0x000071c37f7e50b0 libOSMesa_8.so`osmesa_create_screen at target.c:51:13
frame #9: 0x000071c37f7e6ce7 libOSMesa_8.so`create_st_manager at osmesa.c:159:23
frame #10: 0x000071c448396fa3 libc.so`pthread_once + 83
frame #11: 0x000071c37f7e6c8d libOSMesa_8.so`call_once(flag=0x000071c3805a6008, func=(libOSMesa_8.so`create_st_manager at osmesa.c:153)) at threads_posix.h:96:5
frame #12: 0x000071c37f7e5ba7 libOSMesa_8.so`get_st_manager at osmesa.c:176:4
frame #13: 0x000071c37f7e5afd libOSMesa_8.so`get_st_api at osmesa.c:187:4
frame #14: 0x000071c37f7e5d8f libOSMesa_8.so`OSMesaMakeCurrent(osmesa=0x000071c386500da0, buffer=0x000071c3a96bd040, type=5121, width=1920, height=1080) at osmesa.c:788:27
This commit is contained in:
Duy Tran Khanh 2021-11-07 18:52:57 +07:00 committed by GitHub
parent 4558bf4c2f
commit 3124ef9cbd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -655,6 +655,7 @@ void terminateEgl() {
potatoBridge.eglSurface = EGL_NO_SURFACE;
} break;
//case RENDERER_VIRGL:
case RENDERER_VK_ZINK: {
// Nothing to do here
} break;
@ -670,6 +671,7 @@ JNIEXPORT jlong JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglGetCurrentContext(JNIE
case RENDERER_GL4ES:
return (jlong) eglGetCurrentContext_p();
case RENDERER_VIRGL:
case RENDERER_VK_ZINK:
return (jlong) OSMesaGetCurrentContext_p();
@ -1055,7 +1057,7 @@ Java_org_lwjgl_glfw_GLFW_nativeEglCreateContext(JNIEnv *env, jclass clazz, jlong
if (config_renderer == RENDERER_VK_ZINK || config_renderer == RENDERER_VIRGL) {
printf("OSMDroid: generating context\n");
void* ctx = OSMesaCreateContext_p(OSMESA_RGBA,contextSrc);
printf("OSMDroid: context=%p",ctx);
printf("OSMDroid: context=%p\n",ctx);
return ctx;
}
}