Mesa glGetString() 版本与 glxinfo 不同

Mesa glGetString() version differs from glxinfo

在我的应用程序中有这段代码

void showOpenGLInfo()
{
    printf("Graphic card vendor: %s\n", glGetString(GL_VENDOR));
    printf("Renderer: %s\n", glGetString(GL_RENDERER));
    printf("GL version: %s\n", glGetString(GL_VERSION));
    printf("GLSL version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
}

在应用程序日志中显示此输出:

Graphic card vendor: Intel
Renderer: Mesa Intel(R) UHD Graphics 600 (GLK 2)
GL version: 4.6 (Compatibility Profile) Mesa 20.3.5
GLSL version: 4.60

我已经从源代码构建了 Mesa 驱动程序 22.0.1 版本并且 glxinfo 报告了正确的值:

OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.0.1

我不明白这个区别,有什么提示吗? Debian 11 靶心。

添加一些OpenGL信息:

OpenGL vendor string: Intel
OpenGL renderer string: Mesa Intel(R) UHD Graphics 600 (GLK 2)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 22.0.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6 (Compatibility Profile) Mesa 22.0.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 22.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

根据评论添加其他信息:

ldd /usr/bin/glxinfo
    linux-vdso.so.1 (0x00007ffc9c5f6000)
    libGLEW.so.2.1 => /lib/x86_64-linux-gnu/libGLEW.so.2.1 (0x00007f3b2a68f000)
    libGLU.so.1 => /lib/x86_64-linux-gnu/libGLU.so.1 (0x00007f3b2a61f000)
    libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f3b2a598000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f3b2a454000)
    libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f3b2a311000)
    libXext.so.6 => /lib/x86_64-linux-gnu/libXext.so.6 (0x00007f3b2a2fc000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f3b2a135000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f3b29f68000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f3b29f4e000)
    libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f3b29e96000)
    libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f3b29e62000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f3b2a760000)
    libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f3b29e37000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f3b29e2f000)
    libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f3b29e2a000)
    libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f3b29c24000)
    libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f3b29c0d000)
    libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f3b29c00000)

ldd my_application 
    linux-vdso.so.1 (0x00007ffe0092c000)
    libc.so.6 => /lib/x86-64-linux-gnu/libc.so.6 (0x00007f1f23936000)
    libz.so.1 => /lib/x86-64-linux-gnu/libz.so.1 (0x00007f1f2391a000)
    libSDL2-2.0.so.0 => /lib/x86-64-linux-gnu/libSDL2-2.0.so.0 (0x00007f1f237c5000)
    libSDL2_image-2.0.so.0 => /lib/x86-64-linux-gnu/libSDL2_image-2.0.so.0 (0x00007f1f237a2000)
    libdl.so.2 => /lib/x86-64-linux-gnu/libdl.so.2 (0x00007f1f2379c000)
    libm.so.6 => /lib/x86-64-linux-gnu/libm.so.6 (0x00007f1f2364d000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1f23b4e000)
    libasound.so.2 => /lib/x86-64-linux-gnu/libasound.so.2 (0x00007f1f23550000)
    libpulse.so.0 => /lib/x86-64-linux-gnu/libpulse.so.0 (0x00007f1f234fb000)
    libX11.so.6 => /lib/x86-64-linux-gnu/libX11.so.6 (0x00007f1f233be000)
    libXext.so.6 => /lib/x86-64-linux-gnu/libXext.so.6 (0x00007f1f233a9000)
    libXcursor.so.1 => /lib/x86-64-linux-gnu/libXcursor.so.1 (0x00007f1f2339c000)
    libXinerama.so.1 => /lib/x86-64-linux-gnu/libXinerama.so.1 (0x00007f1f23397000)
    libXi.so.6 => /lib/x86-64-linux-gnu/libXi.so.6 (0x00007f1f23383000)
    libXrandr.so.2 => /lib/x86-64-linux-gnu/libXrandr.so.2 (0x00007f1f23376000)
    libXss.so.1 => /lib/x86-64-linux-gnu/libXss.so.1 (0x00007f1f23371000)
    libXxf86vm.so.1 => /lib/x86-64-linux-gnu/libXxf86vm.so.1 (0x00007f1f2336a000)
    libwayland-egl.so.1 => /lib/x86-64-linux-gnu/libwayland-egl.so.1 (0x00007f1f23365000)
    libwayland-client.so.0 => /lib/x86-64-linux-gnu/libwayland-client.so.0 (0x00007f1f23354000)
    libwayland-cursor.so.0 => /lib/x86-64-linux-gnu/libwayland-cursor.so.0 (0x00007f1f23347000)
    libxkbcommon.so.0 => /lib/x86-64-linux-gnu/libxkbcommon.so.0 (0x00007f1f23305000)
    libpthread.so.0 => /lib/x86-64-linux-gnu/libpthread.so.0 (0x00007f1f232e2000)
    libpng16.so.16 => /lib/x86-64-linux-gnu/libpng16.so.16 (0x00007f1f232aa000)
    libjpeg.so.8 => /lib/x86-64-linux-gnu/libjpeg.so.8 (0x00007f1f23225000)
    libtiff.so.5 => /lib/x86-64-linux-gnu/libtiff.so.5 (0x00007f1f231a4000)
    libwebp.so.6 => /lib/x86-64-linux-gnu/libwebp.so.6 (0x00007f1f23138000)
    libpulsecommon-13.99.so => /usr/lib/x86-64-linux-gnu/pulseaudio/libpulsecommon-13.99.so (0x00007f1f230b6000)
    libdbus-1.so.3 => /lib/x86-64-linux-gnu/libdbus-1.so.3 (0x00007f1f23065000)
    libxcb.so.1 => /lib/x86-64-linux-gnu/libxcb.so.1 (0x00007f1f2303b000)
    libXrender.so.1 => /lib/x86-64-linux-gnu/libXrender.so.1 (0x00007f1f22e31000)
    libXfixes.so.3 => /lib/x86-64-linux-gnu/libXfixes.so.3 (0x00007f1f22e27000)
    libffi.so.7 => /lib/x86-64-linux-gnu/libffi.so.7 (0x00007f1f22e1b000)
    libzstd.so.1 => /lib/x86-64-linux-gnu/libzstd.so.1 (0x00007f1f22d72000)
    liblzma.so.5 => /lib/x86-64-linux-gnu/liblzma.so.5 (0x00007f1f22d49000)
    libjbig.so.0 => /lib/x86-64-linux-gnu/libjbig.so.0 (0x00007f1f22b3b000)
    libsystemd.so.0 => /lib/x86-64-linux-gnu/libsystemd.so.0 (0x00007f1f22a8a000)
    libwrap.so.0 => /lib/x86-64-linux-gnu/libwrap.so.0 (0x00007f1f22a7e000)
    libsndfile.so.1 => /lib/x86-64-linux-gnu/libsndfile.so.1 (0x00007f1f22a00000)
    libasyncns.so.0 => /lib/x86-64-linux-gnu/libasyncns.so.0 (0x00007f1f227fa000)
    libapparmor.so.1 => /lib/x86-64-linux-gnu/libapparmor.so.1 (0x00007f1f227e5000)
    librt.so.1 => /lib/x86-64-linux-gnu/librt.so.1 (0x00007f1f227db000)
    libXau.so.6 => /lib/x86-64-linux-gnu/libXau.so.6 (0x00007f1f227d3000)
    libXdmcp.so.6 => /lib/x86-64-linux-gnu/libXdmcp.so.6 (0x00007f1f227cb000)
    liblz4.so.1 => /lib/x86-64-linux-gnu/liblz4.so.1 (0x00007f1f227aa000)
    libgcrypt.so.20 => /lib/x86-64-linux-gnu/libgcrypt.so.20 (0x00007f1f2268c000)
    libnsl.so.1 => /lib/x86-64-linux-gnu/libnsl.so.1 (0x00007f1f2266f000)
    libFLAC.so.8 => /lib/x86-64-linux-gnu/libFLAC.so.8 (0x00007f1f2262f000)
    libogg.so.0 => /lib/x86-64-linux-gnu/libogg.so.0 (0x00007f1f22622000)
    libvorbis.so.0 => /lib/x86-64-linux-gnu/libvorbis.so.0 (0x00007f1f225f4000)
    libvorbisenc.so.2 => /lib/x86-64-linux-gnu/libvorbisenc.so.2 (0x00007f1f22549000)
    libresolv.so.2 => /lib/x86-64-linux-gnu/libresolv.so.2 (0x00007f1f2252d000)
    libbsd.so.0 => /lib/x86-64-linux-gnu/libbsd.so.0 (0x00007f1f22513000)
    libgpg-error.so.0 => /lib/x86-64-linux-gnu/libgpg-error.so.0 (0x00007f1f224ee000)

我发现了错误。我的应用程序指向 /lib/x86-64-linux-gnu 而不是 /lib/x86_64-linux-gnu。现在我可以使用从源代码构建的 Mesa 22.01。非常感谢@genpfault 和@derhass 的帮助