1#pragma pack_matrix(row_major) 2 3struct MyBuffer1 4{ 5 column_major float4x4 mat1; 6 row_major float4x4 mat2; 7 /*floating*/ float4x4 mat3; 8}; 9 10#pragma pack_matrix(column_major) 11 12struct MyBuffer2 13{ 14 column_major float4x4 mat1; 15 row_major float4x4 mat2; 16 /*floating*/ float4x4 mat3; 17}; 18 19#pragma pack_matrix(random_string_foo) 20 21cbuffer Example 22{ 23 MyBuffer1 g_MyBuffer1; 24 MyBuffer2 g_MyBuffer2; 25 column_major float4x4 mat1a; 26}; 27 28float4 main() : SV_Target0 29{ 30 return 31 g_MyBuffer1.mat1[0] + g_MyBuffer1.mat2[0] + g_MyBuffer1.mat3[0] + 32 g_MyBuffer2.mat1[0] + g_MyBuffer2.mat2[0] + g_MyBuffer2.mat3[0]; 33} 34