nickguletskii / GLXOSD

GLXOSD is an extensible on-screen display (OSD)/overlay for OpenGL applications running on Linux with X11 which aims to provide similar functionality to MSI Afterburner/RivaTuner OSD. It can show FPS, frame timings, temperatures and more in OpenGL games and applications. It can also be used to benchmark games, much like voglperf.
https://glxosd.nickguletskii.com
MIT License
123 stars 20 forks source link

GLXOSD not working with SuperTuxKart #87

Open SuicSoft opened 7 years ago

SuicSoft commented 7 years ago

When I run glxosd ./run_game.sh the GLXOSD HUD does not appear in SuperTuxKart.There are lots of errors in the output like :

stack traceback: /usr/share/glxosd//glxosd/util/util.lua:24: in function 'log_error' /usr/share/glxosd//glxosd/rendering/shader_support.lua:28: in function 'shader_error' /usr/share/glxosd//glxosd/rendering/shader_support.lua:44: in function 'create_shader' /usr/share/glxosd//glxosd/rendering/shader_support.lua:53: in function 'create_shader_program' /usr/share/glxosd//glxosd/rendering/TextRenderer.lua:316: in function 'init' /usr/share/glxosd//glxosd/rendering/TextRenderer.lua:377: in function 'new' /usr/share/glxosd//glxosd/plugins/OSD/OSD.lua:93: in function 'init_renderer' /usr/share/glxosd//glxosd/plugins/OSD/OSD.lua:61: in function 'render' /usr/share/glxosd//glxosd/Context.lua:51: in function 'func' /usr/share/glxosd//glxosd/Context.lua:29: in function </usr/share/glxosd//glxosd/Context.lua:29> [C]: in function 'pcall' /usr/share/glxosd//glxosd/Context.lua:29: in function 'each_plugin' /usr/share/glxosd//glxosd/Context.lua:50: in function 'render' /usr/share/glxosd//glxosd/Main.lua:139: in function </usr/share/glxosd//glxosd/Main.lua:138> [C]: in function 'xpcall' /usr/share/glxosd//glxosd/rendering/normalise_gl_state.lua:168: in function 'do_when_gl_state_is_normal' /usr/share/glxosd//glxosd/Main.lua:138: in function </usr/share/glxosd//glxosd/Main.lua:122> Error while exectuing plugin: /usr/share/glxosd//glxosd/rendering/shader_support.lua:29: Failed to compile the shader! stack traceback: /usr/share/glxosd//glxosd/util/util.lua:24: in function 'log_error' /usr/share/glxosd//glxosd/Context.lua:31: in function 'each_plugin' /usr/share/glxosd//glxosd/Context.lua:50: in function 'render' /usr/share/glxosd//glxosd/Main.lua:139: in function </usr/share/glxosd//glxosd/Main.lua:138> [C]: in function 'xpcall' /usr/share/glxosd//glxosd/rendering/normalise_gl_state.lua:168: in function 'do_when_gl_state_is_normal' /usr/share/glxosd//glxosd/Main.lua:138: in function </usr/share/glxosd//glxosd/Main.lua:122>

nickguletskii commented 7 years ago

It seems like SuperTuxKart is starting in a legacy OpenGL context. According to the source code of STK, the log should contain something like Creating legacy OpenGL 2.1 context.... Could you please check if that is the case?

SuicSoft commented 7 years ago

@nickguletskii Where is the log ?

nickguletskii commented 7 years ago

Hmm, it seems that STK's engine doesn't log anywhere...

Do you get the same problems with other programs? I am 98% confident that this happens because STK creates a legacy context, and GLXOSD working in other applications would indirectly prove that.

SuicSoft commented 7 years ago

@nickguletskii Why would it create a legacy context.I have a Radeon HD 7640G with fglrx

nickguletskii commented 7 years ago

I've stumbled upon your issues on STK's issue tracker and it seems that GLXOSD isn't the only thing having issues with shader compilation. Since the shaders aren't actually written by me (they are shaders from freetype-gl) and seem to work fine both on systems with NVIDIA proprietary drivers and Mesa, I am guessing that the issue is either with STK's context management, or with fglrx itself (AMD drivers aren't known for their quality). In both cases I am not sure how I can be of any help, since I have experience with neither.

You could probably narrow down your issue by checking if GLXOSD works in glxgears. If it does, then the issue is probably with STK itself, and if it doesn't, your drivers are at fault.

SuicSoft commented 7 years ago

@nickguletskii GLXOSD works perfectly with glxgears and Neverball