I’m trying to build VTK to use x11 and opengles as rendering backend in an embedded system(RK3588). I can’t use the EGL pipeline because my board doesn’t support EGL, but it supports x11. So I tried to build VTK with VTK_OPENGL_USE_GLES
= ON and VTK_USE_X
= ON , it builds with no error. However when I try to use it for volumerending, it works fine but I don’t think GPU is used. The Example I use is nearly the same as SimpleRayCast. I add some code to debug, I find vtkXOpenGLRenderWindow is already being used.
std::cout << "GetNumberOfDevices : " << renWin->GetNumberOfDevices() << std::endl;
std::cout << "GetRenderingBackend : " << renWin->GetRenderingBackend() << std::endl;
vtkXOpenGLRenderWindow *glRenWin =
vtkXOpenGLRenderWindow::SafeDownCast(renWin);
std::cout << "renWin->GetClassName() : "<< renWin->GetClassName()<< std::endl;
if(glRenWin)
{
int major;
int minor;
glRenWin->GetOpenGLVersion(major, minor);
//std::cout << glRenWin->ReportCapabilities() << std::endl;
std::cout << glRenWin->GetOpenGLSupportMessage() << std::endl;
std::cout << glRenWin->SupportsOpenGL() << std::endl;
std::cout << "OpenGL : "<<major << " . " << minor << std::endl;
}
The code above print out something like:
GetNumberOfDevices : 0
GetRenderingBackend : OpenGL2
renWin->GetClassName() : vtkXOpenGLRenderWindow
Not tested yet
1
OpenGL : 4 . 5
I think the OpenGL version should be something like 3.2(opengles)
I run glmark2 on my system and it print out something like:
forlinx@ok3588:~$ glmark2
arm_release_ver of this libmali is 'g6p0-01eac0', rk_so_ver is '6'.
=======================================================
glmark2 2021.12
=======================================================
OpenGL Information
GL_VENDOR: ARM
GL_RENDERER: Mali-LODX
GL_VERSION: OpenGL ES 3.2 v1.g6p0-01eac0.ba52c908d926792b8f5fe28f383a2b03
=======================================================
[build] use-vbo=false:^C FPS: 1471 FrameTime: 0.680 ms
=======================================================
glmark2 Score: 1471
=======================================================
glxinfo is something like:
forlinx@ok3588:~$ glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa/X.org (0xffffffff)
Device: llvmpipe (LLVM 12.0.0, 128 bits) (0xffffffff)
Version: 21.2.6
Accelerated: no
Video memory: 7610MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 3.1
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa/X.org
OpenGL renderer string: llvmpipe (LLVM 12.0.0, 128 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 21.2.6
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.1 Mesa 21.2.6
OpenGL shading language version string: 1.40
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
So where am I doing wrong? Or It just doesn’t work like that.