ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.25k stars 223 forks source link

[RK3326/Mali] Assertion failure Shovel Knight #346

Closed Cebion closed 1 year ago

Cebion commented 3 years ago

Hi, I'm trying to run ShovelKnight on an RK3326 powered device Mali G31 GPU (ibmali-rk-bifrost-g31-rxp0) via GL4ES. I compiled GL4ES with -DODROID=ON -DGBM=ON -DNOX11=ON.

I run the game via BOX86_LIBGL=libGL.so.1 LIBGL_FB=4 LIBGL_ES=2 LIBGL_GL=21 LIBGL_DIBGL_FBOFORCETEX=1 box86 ShovelKnight

GL4es loads fine and I get the warning

Warning, function glXGetClientString not found in lib libGL.so.1 Warning, function glXGetClientString not found in lib libGL.so.1 Warning, function glXQueryVersion not found in lib libGL.so.1 Warning, function glXQueryVersion not found in lib libGL.so.1 librga:RGA_GET_VERSION:4.00,4.000000 ctx=0x633e6cd0,ctx->rgaFd=8 Rga built version:8827628f Using native(wrapped) libSDL2-2.0.so.0 ycMemory::Init() GL Version: 2.10 ycAssert! ../engine/src/ycRenderDeviceGL.cpp: 324 if(!(err == GLEW_OK)): Glew setup failed! WARN:

Assertion failure at Break (../engine/src/ycAssert.cpp:101), triggered 1 time: '0'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA]

If I press Ignore the Game starts and runs perfect. Hope you have an Idea.

Thanks in advance

m trying to get box86 to run games on an RK3326 powered device using a Mali G31 GPU (ArkOS, libmali-rk-bifrost-g31-rxp0-wayland-gbm_1.7-2+deb10_armhf drivers from HardKernel), using Shovel Knight as a starting point.

ptitSeb commented 3 years ago

It seems you built gl4es without X11 support, so a few fonctions (glXGetClientString and glXQueryVersion at least) are not found? I assume it does mess up libGLEW a bit?

Cebion commented 3 years ago

Yeah, I built it without x11 because we don't support x11. To test it I built it with x11 support but then gl4es doesnt get initialized at all and the log tells that

Using native(wrapped) libGL.so.1 Warning, function glXGetClientString not found in lib libGL.so.1 Warning, function glXGetClientString not found in lib libGL.so.1 Warning, function glGetString not found in lib libGL.so.1 Warning, function glGetString not found in lib libGL.so.1 Warning, function glXQueryVersion not found in lib libGL.so.1 Warning, function glXQueryVersion not found in lib libGL.so.1 librga:RGA_GET_VERSION:4.00,4.000000 ctx=0x633818d8,ctx->rgaFd=3 Rga built version:8827628f Using native(wrapped) libSDL2-2.0.so.0 Warning, function glClearDepth not found in lib libGL.so.1 Warning, function glClearDepth not found in lib libGL.so.1

ptitSeb commented 3 years ago

Ok. I'll see if I can add the 2 previous glX function to gl4es when built without X11 but with gbm

ptitSeb commented 3 years ago

So, I have pushed a commit on gl4es to add a few more glX function to a NOX11 build. Not sure if it will be enough.

Cebion commented 3 years ago

Thanks! I'll test this evening

Cebion commented 3 years ago

The GLX warning are gone =) Sadly the assertion warning still happens.

Here is the full start log: Debug level is 1 BOX86 using "/roms/ports/gl4es/armhf/libGL.so.1" as libGL.so.1 Dynarec for ARM, with extension: HALF FAST_MULT EDSP NEON VFPv4 IDIVA PageSize:4096 Box86 with Dynarec v0.2.1 8e44e8bf built on Feb 22 2021 22:46:31 BOX86_LD_LIBRARY_PATH: /roms/ports/lib86/ Using default BOX86_PATH: ./:bin/ Counted 26 Env var Looking for ShovelKnight Using native(wrapped) libpthread.so.0 Using emulated /storage/roms/ports/shovel/32/lib/libfmodex.so Using native(wrapped) libdl.so.2 Using emulated /roms/ports/lib86/libstdc++.so.6 Using native(wrapped) libm.so.6 Using native(wrapped) libc.so.6 Using native(wrapped) ld-linux.so.2 Using native(wrapped) librt.so.1 Using emulated /roms/ports/lib86/libgcc_s.so.1 Using emulated /storage/roms/ports/shovel/32/lib/libfmodevent.so Using emulated /storage/roms/ports/shovel/32/lib/libfmodex-4.44.33.so Using emulated /storage/roms/ports/shovel/32/lib/libBox2D.so.2.1.0 Using emulated /storage/roms/ports/shovel/32/lib/libGLEW.so.1.10 LIBGL: Initialising gl4es LIBGL: v1.1.5 built on Feb 27 2021 11:46:11 LIBGL: using GBM LIBGL: Using GLES 2.0 backend LIBGL: loaded: libGLESv2.so LIBGL: loaded: libEGL.so LIBGL: loaded: libgbm.so LIBGL: loaded: libdrm.so LIBGL: Using GLES 2.0 backend LIBGL: GBM on card /dev/dri/card0 is Available LIBGL: Hardware Full NPOT detected and used LIBGL: Extension GL_EXT_blend_minmax detected and used LIBGL: FBO are in core, and so used LIBGL: PointSprite are in core, and so used LIBGL: CubeMap are in core, and so used LIBGL: BlendColor is in core, and so used LIBGL: Blend Substract is in core, and so used LIBGL: Blend Function and Equation Separation is in core, and so used LIBGL: Texture Mirrored Repeat is in core, and so used LIBGL: Extension GL_OES_mapbuffer detected LIBGL: Extension GL_OES_element_index_uint detected and used LIBGL: Extension GL_OES_packed_depth_stencil detected and used LIBGL: Extension GL_OES_depth24 detected and used LIBGL: Extension GL_OES_rgb8_rgba8 detected and used LIBGL: Extension GL_EXT_texture_format_BGRA8888 detected and used LIBGL: Extension GL_OES_depth_texture detected and used LIBGL: Extension GL_OES_texture_stencil8 detected and used LIBGL: Extension GL_EXT_texture_rg detected and used LIBGL: Extension GL_EXT_color_buffer_float detected and used LIBGL: Extension GL_EXT_color_buffer_half_float detected and used LIBGL: high precision float in fragment shader available and used LIBGL: Max vertex attrib: 16 LIBGL: Extension GL_OES_standard_derivatives detected and used LIBGL: Max texture size: 8192 LIBGL: Max Varying Vector: 15 LIBGL: Texture Units: 16/16 (hardware: 16), Max lights: 8, Max planes: 6 LIBGL: Max Color Attachments: 1 / Draw buffers: 1 LIBGL: Hardware vendor is ARM LIBGL: GLSL 300 es supported LIBGL: GLSL 310 es supported and used LIBGL: sRGB surface supported LIBGL: EGLImage to Texture2D supported LIBGL: EGLImage to RenderBuffer supported LIBGL: Targeting OpenGL 2.1 LIBGL: NPOT texture handled in hardware LIBGL: Not trying to batch small subsequent glDrawXXXX LIBGL: try to use VBO LIBGL: glXMakeCurrent FBO workaround enabled LIBGL: FBO workaround for using binded texture enabled LIBGL: Force texture for Attachment color0 on FBO LIBGL: Hack to trigger a SwapBuffers when a Full Framebuffer Blit on default FBO is done LIBGL: glX Will try to recycle EGL Surface LIBGL: Current folder is:/storage/roms/ports/shovel/32 Using native(wrapped) libGL.so.1 librga:RGA_GET_VERSION:4.00,4.000000 ctx=0x633efc70,ctx->rgaFd=8 Rga built version:8827628f Using native(wrapped) libSDL2-2.0.so.0 ycMemory::Init() GL Version: 2.10 ycAssert! ../engine/src/ycRenderDeviceGL.cpp: 324 if(!(err == GLEW_OK)): Glew setup failed! WARN:

Assertion failure at Break (../engine/src/ycAssert.cpp:101), triggered 1 time: '0'

Abort/Break/Retry/Ignore/AlwaysIgnore? [abriA] :

ptitSeb commented 3 years ago

Yeah, well, I'll need to check in libglew itself how the init is done, to see what's missing. not sure when I'll do that.

Cebion commented 3 years ago

No hurry, thanks for the effort!

JohnnyonFlame commented 2 years ago

Fixed in https://github.com/ptitSeb/gl4es/commit/59c2ba4279f01a99cbcaf1b71aad805a0c8693bd