What is a correct and best way to upload Matrix4 with a single GL call?
GL class has three versions of UniformMatrix4:
- Single value
- ref Single value
- Single* value
I understand that the first version safely fixes the whole array passed to it, but it is not convenient to convert Matrix to Single.
For the second version, I have no idea what really gets fixed and what not. If I pass in ref matrix4array.Row0.X, does the whole array really get fixed or not?
Currently I am using the last version, with my own version of UniformMatrix4 that takes in ref Matrix4 matrix, and which uses fixed (float* matrix_ptr = &matrix.Row0.X). I hope this does the right thing, but I wonder if the ref Single value version would work too?