Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use vendor-neutral OpenGL implementation instead of legacy GLX. #15778

Closed
wants to merge 1 commit into from

Conversation

vanfanel
Copy link
Contributor

@vanfanel vanfanel commented Oct 8, 2023

Description

Nowadays vendor-neutral GL is used instead of GLX is used in all GNU/Linux distributions.

So, using -lOpenGL works for X11, KMS/DRM and Wayland, while legacy -lGL only works for X11.

Reviewers

@hunterk

@LibretroAdmin
Copy link
Contributor

How would we go about fixing the CI build error for linux-c89?

@vanfanel
Copy link
Contributor Author

I don't quite understand why this c89 configuration tries to build code with GLX calls.
What configure parameter is causing that?

@gouchi
Copy link
Member

gouchi commented Oct 10, 2023

@vanfanel For the Linux building of Github CI so we should check for C89_BUILD ?

@MistyDreams
Copy link

MistyDreams commented Oct 10, 2023

The c89 fails without this commit anyway.

CC cores/libretro-video-processor/video_processor_v4l2.c
cores/libretro-video-processor/video_processor_v4l2.c: In function ‘libretro_videoprocessor_retro_set_environment’:
cores/libretro-video-processor/video_processor_v4l2.c:286:4: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  286 |    bool no_content = true;

edit moving that variable up one line will fix the build issue with C89_BUILD=1. Make sure libglvnd packages are installed on the buildbot, if you want to do it this way.

@vanfanel
Copy link
Contributor Author

@hunterk can you take a look?

@hizzlekizzle
Copy link
Contributor

Hmm, fails with a bunch of glx linking errors on my machine, as well. :/

@gouchi
Copy link
Member

gouchi commented Oct 17, 2023

Same errors and I have libglvnd.

@vanfanel
Copy link
Contributor Author

How can it be? It just swaps -lGL with -lOpenGL

Using OpenGL shouldn't imply using GLX code at all. That makes zero sense.

@MistyDreams
Copy link

MistyDreams commented Oct 17, 2023

Hmm, fails with a bunch of glx linking errors on my machine, as well. :/

you probably havent installed the libs what distro are you using ill get you the package names this is basic stuff though.

apt install libglvnd0

if thats not installing the libs add a apt-get install libopengl0 and any other libs you might need if they dont auto install with libglvnd0. If its not ubuntu/debian tell me the distro ill get the package names for you.

@LibretroAdmin
Copy link
Contributor

pushed a c89buildfix for the video preprocessor

@vanfanel
Copy link
Contributor Author

vanfanel commented Nov 1, 2023

So it should build now?

@keithbowes
Copy link
Contributor

Good idea, but would it be possible to use -lGL if -lOpenGL isn't available? The check_lib function seems not to allow to continue if the library isn't found, but I suppose it would be possible to make a compile-time option like --enable-legacy-glx.

@LibretroAdmin
Copy link
Contributor

LibretroAdmin commented Sep 11, 2024

Decided to approach this in a different way.

8abe49a

You can build with vendor-neutral GL implementation by running this before compiling:

./configure --disable-glx

@vanfanel
Copy link
Contributor Author

I love how this ended up being solved :)

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.

6 participants