File: hlsl.matrixSwizzle.vert

package info (click to toggle)
glslang 16.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,712 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (33 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
void ShaderFunction(float inf) : COLOR0
{
    float3x4 m;

    // tests that convert to non-matrix swizzles

    m._34  = 1.0; // AST should have a normal component select
    m._m23 = 2.0; // same code
    m[2][3] = 2.0; // same code

    m._11_12_13_14 = float4(3.0);      // AST should have normal column selection (first row)
    m._m10_m11_m12_m13 = float4(3.0);  // AST should have normal column selection (second row)
    m[1] = float4(3.0);                // same code

    // tests that stay as matrix swizzles

    float3 f3;
    m._11_22_23 = f3;
    m._21_12_31 = float3(5.0);
    m._11_12_21 = 2 * f3;

    // r-value
    f3 = m._21_12_31;
}

float3x3 createMat3x3(float3 a, float3 b, float3 c)
{
    float3x3 m;
    m._11_21_31 = a;
    m._12_22_32 = b;
    m._13_23_33 = c;
    return m;
}