[Mesa-dev] [PATCH] glsl: Fail linkage when UBO exceeds GL_MAX_UNIFORM_BLOCK_SIZE.

Ilia Mirkin imirkin at alum.mit.edu
Tue Jun 16 07:29:48 PDT 2015

On Tue, Jun 16, 2015 at 10:22 AM, Roland Scheidegger <sroland at vmware.com> wrote:
> This looks like a good idea to me.
> That said, llvmpipe would still crash if the declared size in the shader
> wouldn't exceed the max uniform block size, but the bound buffer does
> IIRC (the test doesn't test this but could be easily modified to do so).
> So, I'm wondering if we should do both - fail to link if the declared
> size exceeds the limit, and just limit the size we copy in llvmpipe to
> the limit, though it's possible this would require some more changes to
> be really safe so we don't try to access such elements (with indirect
> access, though we don't verify direct ones at all) in the shader.

Not to derail this too much, but just FWIW I just checked this patch
in to prevent gpu errors:

Didn't fix the trace, but at least it no longer complained about
illegal sizes. Trace available at


It just renders black now. The claim is that the game (but not
necessarily the trace) works OK on NVIDIA blob drivers. I haven't
analyzed the trace in much detail yet.


More information about the mesa-dev mailing list