Code: Select all
shared_params shadowParams
{
// should probably construct this object in code to set the array lengths
shared_param_named csmSplits float [9]
}Code: Select all
uniform float csmSplits[4],
One obvious fix would be to either throw an exception or log a warning. However, I think an even better solution would be to just work as long as the destination array is less than or equal to the source array, and only throw an exception if the source array is too small.
This would be useful to me because I have a family of shaders which take arrays of different sizes (depending on how many shadow cascades are selected), and it is nice to be able to feed them all from a single set of shared parameters.
Any thoughts or opinions? I already have a patch for my preferred solution.