Home | History | Annotate | Download | only in Test
      1 
      2 struct PS_OUTPUT { float4 color : SV_Target0; };
      3 
      4 int    i;
      5 uint   u;
      6 float  f;
      7 bool   b;
      8 
      9 int2   i2;
     10 uint2  u2;
     11 float2 f2;
     12 bool2  b2;
     13 
     14 Buffer    <float>  g_tTexbfs;
     15 Texture1D <float4> g_tTex1df4;
     16 uint  upos;
     17 float fpos;
     18 
     19 PS_OUTPUT main()
     20 {
     21     // Same shapes:
     22 
     23     float r00 = max(b,  f);
     24     uint  r01 = max(b,  u);
     25     int   r02 = max(b,  i);
     26     float r03 = max(i,  f);
     27     float r04 = max(u,  f);
     28 
     29     float2 r10 = max(b2,  f2);
     30     uint2  r11 = max(b2,  u2);
     31     int2   r12 = max(b2,  i2);
     32     float2 r13 = max(i2,  f2);
     33     float2 r14 = max(u2,  f2);
     34 
     35     float2 r20 = clamp(i2, u2, f2);  // 3 args, converts all to best type.
     36     uint2  r21 = clamp(b2, u2, b2);
     37     float2 r22 = clamp(b2, f2, b2);
     38 
     39     // Mixed shapes:
     40     float2 r30 = max(b,  f2);
     41     uint2  r31 = max(b,  u2);
     42     int2   r32 = max(b,  i2);
     43     float2 r33 = max(i,  f2);
     44     float2 r34 = max(u,  f2);
     45 
     46     float2 r40 = clamp(i, u2, f2);  // 3 args, converts all to best type.
     47     uint2  r41 = clamp(b2, u, b2);
     48     float2 r42 = clamp(b2, f, b);
     49     int2   r43 = clamp(i, i2, u2);
     50 
     51     float r50 = g_tTexbfs.Load(upos);
     52     float r51 = g_tTexbfs.Load(fpos);
     53 
     54     int MipLevel;
     55 
     56     uint WidthU;
     57     uint HeightU;
     58     uint ElementsU;
     59     uint DepthU;
     60     uint NumberOfLevelsU;
     61     uint NumberOfSamplesU;
     62 
     63     int  WidthI;
     64     int  HeightI;
     65     int  ElementsI;
     66     int  DepthI;
     67     int  NumberOfLevelsI;
     68     int  NumberOfSamplesI;
     69 
     70     g_tTex1df4 . GetDimensions(WidthI);
     71     g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsU);
     72     g_tTex1df4 . GetDimensions(6, WidthU, NumberOfLevelsI);
     73     g_tTex1df4 . GetDimensions(6, WidthI, NumberOfLevelsI);
     74 
     75     // max(i2, f2);
     76     PS_OUTPUT ps_output;
     77     ps_output.color = r00;
     78     return ps_output;
     79 };
     80