1 2void Fn1(float4x4 p) { } 3 4float4 main() : SV_TARGET 5{ 6 const float4x4 mat1c = 0.20; 7 const float4x4 mat2c = {2, 2.1, 2.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 8 const float4x4 mat3c = (float4x4)float1(0.1); 9 10 float4x4 mat1 = 0.25; 11 float4x4 mat2 = {3, 3.1, 3.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; 12 float4x4 mat3 = (float4x4)0.375; 13 // float4x4 mat5 = (float4x4)Fn2(); // TODO: enable when compex rvalue handling is in place 14 15 float4x4 mat4; 16 mat4 = 0.75; 17 mat4 = float4x4(4, 4.1, 4.2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); 18 mat4 = (float4x4)0.5; 19 20 mat4 *= 0.75; 21 mat4 += 0.75; 22 mat4 -= 0.5; 23 mat4 /= 2.0; 24 25 Fn1(5.0); // test calling fn accepting matrix with scalar type 26 27 return mat1c[0] + mat3c[0] + mat1[1] + mat4[2]; 28} 29