Skip to content

GLX: implement __GLX_VENDOR_LIBRARY_FILENAMES similar to __EGL_VENDOR_LIBRARY_FILENAMES#229

Open
funch0za wants to merge 1 commit into
NVIDIA:masterfrom
funch0za:master
Open

GLX: implement __GLX_VENDOR_LIBRARY_FILENAMES similar to __EGL_VENDOR_LIBRARY_FILENAMES#229
funch0za wants to merge 1 commit into
NVIDIA:masterfrom
funch0za:master

Conversation

@funch0za
Copy link
Copy Markdown

Added support for the __GLX_VENDOR_LIBRARY_FILENAMES environment variable, similar to __EGL_VENDOR_LIBRARY_FILENAMES. This enables loading GLX drivers from a JSON file.
Close #228

…_FILENAMES.

The functionality is similar to using the __EGL_VENDOR_LIBRARY_FILENAMES variable:
gets a json file with a list of drivers for GLX.
@kbrenneman
Copy link
Copy Markdown
Collaborator

What problem is this meant to solve?

EGL has to use the JSON files because it has to work with multiple different window systems, and because EGLDeviceEXT handling by definition requires loading every driver to get their respective device lists. GLX has no such requirement.

With GLX, there is exactly one window system, and that window system provides a way to get a driver name. There is also already an environment variable to override that name when necessary. That driver name, in turn, translates directly to the name of the DSO to load.

@funch0za
Copy link
Copy Markdown
Author

This does not solve some problems. This patch adds the ability to isolate the vendor for GLX.

@kbrenneman
Copy link
Copy Markdown
Collaborator

Isolate it from what?

@kbrenneman
Copy link
Copy Markdown
Collaborator

@funch0za - In what situation would someone want to use this feature?

@funch0za
Copy link
Copy Markdown
Author

This can solve the problem for Linux distributions where each vendor for GLX and EGL is isolated in a separate directory. In such a case, the JSON file can specify the direct path to the vendor’s directory.

@kbrenneman
Copy link
Copy Markdown
Collaborator

I'm curious if you have an example of such a system, given that the main purpose of libglvnd is so that you don't need to isolate vendor libraries like that anymore. Not to mention the fact that most vendor libraries consist of multiple DSOs, not just whichever one has libglvnd's main entrypoint.

If for some reason you do need to do such a thing, though, then you can just set LD_LIBRARY_PATH, and the existing dlopen call will work. There's no need to add a different, libglvnd-specific environment variable, much less a bunch of extra (and duplicated) code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GLX: implement __GLX_VENDOR_LIBRARY_FILENAMES similar to __EGL_VENDOR_LIBRARY_FILENAMES

2 participants