How many uniforms? ... revisited

Related to this old thread:

This is quite late, but I have a question relating to the MAX_FRAGMENT_UNIFORM_COMPONENTS.

Having seen at:

that the default state of uniforms upon creation in the program is to be zeroed out, it seems reasonable (to me) to also expect the following:

  • given the large number of 2048, components likely stands for bytes; thus MAX_FRAGMENT_UNIFORM_COMPONENTS pertains to the cache size of a fragment processor core;
  • the cache’s dimension is sized based on a “worst case input”, which for shaders seems to be a Matrix4x4 of doubles; this means 16 x 8 bytes = 128 Bytes = 2^7;
  • 2048 Bytes might be feasible to implement in circuitry per each core’s cache.

Now, given (2048 = 2^11) / (128 Bytes = 2^7) = (2^4 = 16) [input Matrix4x4 of doubles that can fit in the fragment processor’s core’s cache].

I do not know why the “cache partition/layout” has to be fixed (possibly it’s simpler circuitry, as and there are many such cores and caches on GPU), but if this is assumed, then the “unit in this layout” should be that of a Matrix4x4 of doubles, because that is the largest input for a single parameter (at least I think so; the usual “correct me if I’m wrong” goes here).

What do you think/know about this ?