File: hlsl.conditional.frag

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (46 lines) | stat: -rw-r--r-- 1,128 bytes parent folder | download | duplicates (6)
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
34
35
36
37
38
39
40
41
42
43
44
45
46
float4 c4;
float4 t4;
float4 f4;
float t;
float f;

float4 vectorCond()
{
    return (c4 ? t4 : f4) +
           (c4 ? t  : f ) +
           (t4 < f4 ? t4 : f4) +
           (c4 ? t : f4);
}

float4 scalarCond()
{
    float4 ret = t != f ? t * f4 : 1;
    return ret;
}

float2 fbSelect(bool2 cnd, float2 src0, float2 src1)
{
    return cnd ? src0 : src1;
}

float4 PixelShaderFunction(float4 input) : COLOR0
{
    int a = 1 < 2 ? 3 < 4 ? 5 : 6 : 7;
    int b = 1 < 2 ? 3 > 4 ? 5 : 6 : 7;
    int c = 1 > 2 ? 3 > 4 ? 5 : 6 : 7;
    int d = 1 > 2 ? 3 < 4 ? 5 : 6 : 7;
    float4 ret = a * input + 
                 b * input +
                 c * input +
                 d * input;
    int e;
    e = a = b ? c = d : 10, b = a ? d = c : 11;
    float4 f;
    f = ret.x < input.y ? c * input : d * input;
    uint g = d > 0.0 ? 0b010101u : 0u;
    uint h = g > 0.0 ? 0B111111u : 0u;
    uint i = h > 0.0 ? 0b0101u : 0B01;
    uint j = i > 0.0 ? 0xabcd : 0xbcda;
    return e * ret + f + vectorCond() + scalarCond() +
           float4(fbSelect(bool2(true, false), float2(1.0, 2.0), float2(3.0, 4.0)), 10.0, 10.0);
}