godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
86.48k stars 19.27k forks source link

Support OpenGL ES + EGL rendering output on Linux/*BSD for single-board computers #50469

Open danboid opened 2 years ago

danboid commented 2 years ago

Godot version

3.3.2 stable

System information

X96 Air Q1000 (Amlogic S905X3, Mali G31), Manjaro unstable, linux 5.13.0, mesa 21.1.4

Issue description

The mali panfrost driver on my TV box works fine with both glmark2-es2 and the reicast dreamcast emu but it isn't detected by godot, instead it uses llvmpipe software rendering.

I have also built 3.3.2 under Manjaro on the RPi 4 using the same scons command but that found the RPi's v3d mesa driver OK.

I get the best GLES performance under sway so I was running godot under sway/Wayland on my Amlogic TV box.

Steps to reproduce

I built godot 3.3.2 under Manjaro ARM unstable from the source tarball downloaded off gh using this command:

scons -j4 platform=x11 use_llvm=yes use_static_cpp=no

When I start godot, it tells me it is using llvmpipe for rendering.

Minimal reproduction project

Not required.

akien-mga commented 2 years ago

Godot's x11 platform is currently written with desktop Linux in mind and it assumes OpenGL support, not OpenGL ES. It shouldn't be too hard to patch it to use the GL ES code path instead, but that probably requires writing an EGL context instead of the current GLX one.

It's basically the same problem as for running Godot on a Raspberry Pi. (And so it might be a duplicate of https://github.com/godotengine/godot-proposals/issues/988 even though it's for a different device.)

Calinou commented 2 years ago

See also https://github.com/efornara/frt.

danboid commented 2 years ago

@akien-mga I know the Jetson boards support OpenGL 4.x but I forgot that the RPi 4 has some OpenGL support, that combined with the fact that the editor renderer dropdown says GLES 2 / GLES 3 made me think the Godot 3.x editor would work with OGLES.

@Calinou - Cool! I didn't know about frt.

What is the minimum version of OGL required by the Linux editor? If it's only OGL 2.0 I could try using GL4ES:

https://github.com/ptitSeb/gl4es

Zireael07 commented 2 years ago

IIRC OpenGL 2.0 but some extensions are required...

Calinou commented 2 years ago

What is the minimum version of OGL required by the Linux editor? If it's only OGL 2.0 I could try using GL4ES:

The GLES2 backend expects full OpenGL 2.1 support, whereas GLES3 expects full OpenGL 3.3 Core Profile support.

vmedea commented 1 year ago

but that probably requires writing an EGL context instead of the current GLX one.

With #68944 I expect this to be fairly straightforward. It adds an EGL backend, just need to use it for X11 too (instead of GLX). (Edit: oh, this issue is about Godot 3, sorry)