glShaderStorageBlockBinding with llvmpipe


I tried to use glShaderStorageBlockBinding with llvmpipe, but the function does not seem to exist.
nm says:

nm /usr/local/lib/libGL.1.dylib | grep ShaderStorageBlockBinding
0000000000641800 t __mesa_ShaderStorageBlockBinding
0000000000641780 t __mesa_ShaderStorageBlockBinding_no_error
000000000042c480 t __mesa_marshal_ShaderStorageBlockBinding
000000000042c450 t __mesa_unmarshal_ShaderStorageBlockBinding

Did I miss something?

System: SDL2+glad gl loader on macos, custom mesa installation with brew with the following adjustments:

ENV.prepend_path "PATH", Formula["llvm"].opt_bin

    mkdir "build" do
      args = ["-Db_ndebug=true"]
      args << "-Dosmesa=true"
      args << "-Dglx=gallium-xlib"
      args << "-Dgallium-drivers=swrast"
      args << "-Dllvm=enabled"
      args << "-Ddraw-use-llvm=true"



glShaderStorageBlockBinding is only available on OpenGL 4.3 or better. Does your system support OpenGL 4.3 or better?

AFAIU llvmpipe supports OpenGL 4.5, that"s what it’s claiming:

OpenGL 4.5
info: Mesa/ 4.5 (Core Profile) Mesa 21.2.3 llvmpipe (LLVM 12.0.1, 256 bits)

Does the version of GLAD you’re using support it?

I guess so, I made sure glad support GL_ARB_shader_storage_buffer_object.
It might be the way I’ve compiled mesa-llvmpipe (?):

args = ["-Db_ndebug=true"]
      args << "-Dosmesa=true"
      args << "-Dglx=gallium-xlib"
      args << "-Dgallium-drivers=swrast"
      args << "-Dllvm=enabled"
      args << "-Ddraw-use-llvm=true"

I checked that it works under linux with an nvidia driver, on a jetson nano, and well, it works. So I guess this is not a GLAD problem, and I’m leaning toward a compilation problem of mesa-llvmpipe…

It may well be.

On Linux, libGL often exports the entire API directly. On other platforms, only a “core” API is exported from the DSO and you need to use the platform-specific *GetProcAddress function to obtain pointers to functions which were added in later OpenGL versions or in extensions. You can do this explicitly or use a loader such as GLEW, GL3W or GLAD to do this for you.

The fact that the MacOS libGL has a function __mesa_ShaderStorageBlockBinding but not glShaderStorageBlockBinding indicates that the function is implemented but you need to use a loader to access it.

I couldn’t sleep last night, thought about it, and came to the same conclusion, it’s certainly the way the loader handles this, I’ll check that out. Thanks!

@GClements : you were right, I had to use OSMesaGetProcAddress instead of SDL_GL_GetProcAddress when loading the GL functions.


This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.