This is a step to finish the D4325 and fix the T61286.
Currently the grid is highlighted in steps of 10 out of 10, which is wrong for the imperial units as seen in buImperialLenDef.
The idea of the code is to pass the steps of the grid already dimensioned as a uniform.
Another important thing to note is that subdivisions now only affect the grid without unity.
This matches with previous versions of Blender.
After unrolling the loop, I see no significant change in peformanse.