opengl – GLSL link fails with C9999 (too many buffer declarations?)

I’m receiving a C9999 (*** exception during compilation ***) linker error for an OpenGl 4.6 compute shader. It seems to be related to the number of SSBOs I have declared (14 separate declarations), but it really doesn’t seem like it should be a problem, given that my GTX 1070 has 96 buffer binding locations.

None of the names are reserved keywords, and I’m not using double underscores. This has happened to me before, but I’ve worked around it by managing to split my code into separate shaders with fewer buffer declarations.

I’m finally asking about it because, for performance reasons, I’d really rather not split this up.

enter image description here

This is all the information the driver gives me in this case.

Update:

While I have received that error for buffers in the past, now I’ve narrowed this down to the following:


buffer _elementmap   { uint elementmap(); };

void element_insert(vec4 element)
{
    uint hash = get_hash(element);
    uint spot = 2 + (hash % (elementmap.length() - 2));
                                        ~~^

    uint pos = atomicAdd(elementmap(0), 1);

    (...)
}

Calling length() on that buffer produces the error for me. Seems like a driver bug. If I pass the length in as a separate buffer or a uniform, it works fine.

Additionally, I have a separate much simpler compute shader that doesn’t include this particular function that uses .length() on that same declaration that does work.