glGetString(GL_EXTENSIONS) returns no GL_EXT_framebuffer_sRGB, which is required by OpenGL 3.0 (src/mesa/main/version.c compute_version)。so glGetString(GL_VERSION) fall back to OpenGL 2.1。 #include <stdio.h> #include <stdlib.h> #define GL_GLEXT_PROTOTYPES #include <GL/osmesa.h> //#include <GL/glext.h> // settings const unsigned int SCR_WIDTH = 960; const unsigned int SCR_HEIGHT = 562; int main(void) { OSMesaContext ctx; ctx = OSMesaCreateContextExt(OSMESA_RGBA, 16, 0, 0, NULL); GLubyte *buffer = malloc(SCR_WIDTH * SCR_HEIGHT * 4 * sizeof(GLubyte)); OSMesaMakeCurrent(ctx, buffer, GL_UNSIGNED_BYTE, SCR_WIDTH, SCR_HEIGHT); printf("GL_RENDERER = %s\n", (char*)glGetString(GL_RENDERER)); printf("GL_VERSION = %s\n", (char*)glGetString(GL_VERSION)); printf("GL_VENDOR = %s\n", (char*)glGetString(GL_VENDOR)); printf("GL_SHADING_LANGUAGE_VERSION = %s\n", (char*)glGetString(GL_SHADING_LANGUAGE_VERSION)); printf("GL_EXTESIONS = %s\n", (char*)glGetString(GL_EXTENSIONS)); return 0; }
Thanks for reporting this, and for the sample program. We are looking into this.
Fixed in 19.0.6: https://www.mesa3d.org/relnotes/19.0.6.html
Closing at of last comment. Suspecting that the issue was resolved by commit "meson: expose glapi through osmesa" which landed in Mesa 19.0.5. Feel free to reopen if the issue persists.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.