/// <summary>
/// Sends a multiple value constant floating-point parameter to the program.
/// </summary>
/// <remarks>
/// This method is made virtual to allow GpuProgramManagers, or even individual
/// GpuProgram implementations to supply their own implementation if need be.
/// An example would be where a Matrix needs to be transposed to row-major format
/// before passing to the hardware.
/// </remarks>
/// <param name="index">Index of the contant register.</param>
/// <param name="val">Structure containing 3 packed float values.</param>
public void SetConstant( int index, Matrix4 val )
{
Matrix4 mat;
// transpose the matrix if need be
if ( transposeMatrices )
{
mat = val.Transpose();
}
else
{
mat = val;
}
SetConstant( index++, mat.m00, mat.m01, mat.m02, mat.m03 );
SetConstant( index++, mat.m10, mat.m11, mat.m12, mat.m13 );
SetConstant( index++, mat.m20, mat.m21, mat.m22, mat.m23 );
SetConstant( index, mat.m30, mat.m31, mat.m32, mat.m33 );
}