Prerequisite - My terminology may be slightly off or bad, please excuse and correct me where ever necessary. Please also excuse that this is my first post. I have often lurked these forums and haven't made an account until recently.
Proposal
I propose that uniforms inside uniform blocks may be initialized by other block members. These initialized uniform block members don't take up user accesses memory (you can't issue a command to change them directly.)
Example
Code :
uniform MatricesUniformBlock {
mat4 ModelMatrix;
mat4 ViewMatrix;
mat4 ProjectionMatrix;
mat4 ModelViewMatrix = ViewMatrix * ModelMatrix;
};
In the above code
ModelViewMatrix's value changes every time
ModelMatrix or
ViewMatrix is updated. Certain vendor implementations
may already kind of do this implicitly when just initializing in the main function
[1], but being explicit about the initialization would be nice.
What do you think?
[1] - I actually have no idea if they do or if it's a trivial optimization.