File: hlsl.intrinsics.promote.frag

package info (click to toggle)
glslang 16.1.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,084 kB
  • sloc: cpp: 90,714; yacc: 4,243; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (79 lines) | stat: -rw-r--r-- 1,725 bytes parent folder | download | duplicates (20)
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79

struct PS_OUTPUT { float4 color : SV_Target0; };

int    i;
uint   u;
float  f;
bool   b;

int2   i2;
uint2  u2;
float2 f2;
bool2  b2;

Buffer    <float>  g_tTexbfs;
Texture1D <float4> g_tTex1df4;
uint  upos;
float fpos;

PS_OUTPUT main()
{
    // Same shapes:

    float r00 = max(b,  f);
    uint  r01 = max(b,  u);
    int   r02 = max(b,  i);
    float r03 = max(i,  f);
    float r04 = max(u,  f);

    float2 r10 = max(b2,  f2);
    uint2  r11 = max(b2,  u2);
    int2   r12 = max(b2,  i2);
    float2 r13 = max(i2,  f2);
    float2 r14 = max(u2,  f2);

    float2 r20 = clamp(i2, u2, f2);  // 3 args, converts all to best type.
    uint2  r21 = clamp(b2, u2, b2);
    float2 r22 = clamp(b2, f2, b2);

    // Mixed shapes:
    float2 r30 = max(b,  f2);
    uint2  r31 = max(b,  u2);
    int2   r32 = max(b,  i2);
    float2 r33 = max(i,  f2);
    float2 r34 = max(u,  f2);

    float2 r40 = clamp(i, u2, f2);  // 3 args, converts all to best type.
    uint2  r41 = clamp(b2, u, b2);
    float2 r42 = clamp(b2, f, b);
    int2   r43 = clamp(i, i2, u2);

    float r50 = g_tTexbfs.Load(upos);
    float r51 = g_tTexbfs.Load(fpos);

    int MipLevel;

    uint WidthU;
    uint HeightU;
    uint ElementsU;
    uint DepthU;
    uint NumberOfLevelsU;
    uint NumberOfSamplesU;

    int  WidthI;
    int  HeightI;
    int  ElementsI;
    int  DepthI;
    int  NumberOfLevelsI;
    int  NumberOfSamplesI;

    g_tTex1df4 . GetDimensions(WidthI);
    g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsU);
    g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsI);
    g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsI);

    // max(i2, f2);
    PS_OUTPUT ps_output;
    ps_output.color = r00;
    return ps_output;
};