Daemon
Daemon copied to clipboard
options from ~/.drirc file are not applied when running Dæmon on Linux but are applied when running other GL software
On Linux the ~/.drirc file is not read. This is a file to tweak specific driver options like disabling or enabling features. This can be used to set specific options to specific drivers or applications for example.
This file is expected to be read by ourselve but some of the libraries involved when we create a GL context.
I noticed that when adding this ~/.drirc file on a computer having an Intel Gen 3 GPU and calling glxinfo the GL version number bumps from 1.4 to 2.1 (while the driver supports 2.1 it is globally hidden to force some applications like Google Chrome to not use OpenGL for some tasks, user may chose to re-enable it for specific applications):
<driconf>
<device driver="i915">
<application name="Default">
<option name="stub_occlusion_query" value="true" />
<option name="fragment_shader" value="true" />
</application>
</device>
</driconf>
But when running Dæmon, it reports GL being too low, meaning those options were not applied when creating the GL context, and the engine got the 1.4 version instead of the expected 2.1 version.
When running Dæmon using environment variables (another way to set drirc options) this way, the engine detects GL 2.1 properly which also means the options are properly supported and enabled by the underlying software stack:
stub_occlusion_query='true' fragment_shader='true' ./daemon
I don't know what is the underlying library not reading ~/.drirc, maybe SDL?
I reproduced the issue on Ubuntu Linux 20.04.2.
Interestingly, other software like glxinfo or glxgears on the exact same system gets ~/.drirc options applied.
This bug (if it is one) is probably outside our code base, though we may want to track it properly and possibly report it elsewhere in order to make sure our software behaves as users want it to behave.