Preliminary implementation of OpenGL detection on Linux #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I promised in #68 that I would implement Linux OpenGL detection, welp I totally forgot that I actually did some kind of detection months ago, so there you have it.
This right now uses only EGL, which is of course a problem. The status of Linux OpenGL suffers from many historical issues, especially X11 therefore we have two main ways how to get GL context in Linux
Getting renderer and vendor is easy, but it gets hard once you want to query memory or even frequency info.
For memory, there are two GL extensions GL_NVX_gpu_memory_info and GL_ATI_meminfo, both work on AMD and NVIDIA, because mesa developers are chads. The problem is both require desktop GL, which would not be a problem, but...
NVIDIA only supports OpenGL ES 2.0 on EGL, so that is a case which needs GLX instead of EGL.
GL_ATI_meminfo is kinda useless because it won't give you the total memory amount only the free parts, I found out that there are functions to get the total amount (GetGPUInfoAMD), but they are only in the WGL association, that is not available on Linux. They may be available in GLX as well, but I have not found them yet.
GL_NVX_gpu_memory_info does not provide any info on the cache/shared memory size.
To this day I have no idea how to get GPU frequency on Linux without using AMD/NVIDIA specific tools and libraries (which we probably don't want to use as well)
I may contribute fixes and developments to this, maybe even GLX implementation in the future, but at this point, I would like to ask you a question I have been asking several times a week for the last year "Why not Vulkan?"