• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1static float2 i = float2(1.0, 2.0);
2
3struct type1
4{
5    void setmem(float4 m) { memVar = m; }
6    void seti(int si) { i = si; }
7    float4 memVar;
8    float4 memFun(float4 a) : SV_Position
9    {
10        return i * a + memVar;
11    }
12    int memFun(int a) : SV_Position
13    {
14        return i + a - memVar.z;
15    }
16    int i;
17};
18
19static float2 j = i;
20
21struct type2
22{
23    float2 memFun() { return i; }
24};
25
26float4 main() : SV_Target0
27{
28   type1 test;
29   test.setmem(float4(2.0,2.0,2.0,2.0));
30   test.seti(17);
31   float4 f4 = float4(1.0,1.0,1.0,1.0);
32   f4 += test.memFun(float4(5.0f,5.0f,5.0f,5.0f));
33   f4 += test.memFun(7);
34   return f4;
35}
36