xref: /aosp_15_r20/external/angle/third_party/glslang/src/Test/hlsl.matrixSwizzle.vert (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1void ShaderFunction(float inf) : COLOR0
2{
3    float3x4 m;
4
5    // tests that convert to non-matrix swizzles
6
7    m._34  = 1.0; // AST should have a normal component select
8    m._m23 = 2.0; // same code
9    m[2][3] = 2.0; // same code
10
11    m._11_12_13_14 = float4(3.0);      // AST should have normal column selection (first row)
12    m._m10_m11_m12_m13 = float4(3.0);  // AST should have normal column selection (second row)
13    m[1] = float4(3.0);                // same code
14
15    // tests that stay as matrix swizzles
16
17    float3 f3;
18    m._11_22_23 = f3;
19    m._21_12_31 = float3(5.0);
20    m._11_12_21 = 2 * f3;
21
22    // r-value
23    f3 = m._21_12_31;
24}
25
26float3x3 createMat3x3(float3 a, float3 b, float3 c)
27{
28    float3x3 m;
29    m._11_21_31 = a;
30    m._12_22_32 = b;
31    m._13_23_33 = c;
32    return m;
33}
34