steve-lunarg | 7f7c2ed | 2016-09-07 15:20:19 -0600 | [diff] [blame] | 1 | |
| 2 | SamplerState g_sSamp1 : register(s0); |
| 3 | SamplerState g_sSamp2; |
| 4 | SamplerState g_sSamp3[2] : register(s2); |
| 5 | SamplerState g_sSamp4[3]; |
| 6 | SamplerState g_sSamp5; |
| 7 | |
| 8 | SamplerState g_sSamp_unused1; |
| 9 | SamplerState g_sSamp_unused2; |
| 10 | |
| 11 | Texture1D g_tTex1 : register(t1); |
| 12 | const uniform Texture1D g_tTex2; |
| 13 | Texture1D g_tTex3[2] : register(t3); |
| 14 | Texture1D g_tTex4[3]; |
| 15 | Texture1D g_tTex5; |
| 16 | |
| 17 | Texture1D g_tTex_unused1 : register(t0); |
| 18 | Texture1D g_tTex_unused2 : register(t2); |
| 19 | Texture1D g_tTex_unused3; |
| 20 | |
| 21 | struct MyStruct_t { |
| 22 | int a; |
| 23 | float b; |
| 24 | float3 c; |
| 25 | }; |
| 26 | |
| 27 | uniform MyStruct_t mystruct : register(b4); |
| 28 | |
| 29 | struct PS_OUTPUT |
| 30 | { |
| 31 | float4 Color : SV_Target0; |
| 32 | }; |
| 33 | |
| 34 | uniform float4 myfloat4_a; |
| 35 | uniform float4 myfloat4_b; |
| 36 | uniform int4 myint4_a; |
| 37 | |
| 38 | float4 Func1() |
| 39 | { |
| 40 | return |
| 41 | g_tTex1 . Sample(g_sSamp1, 0.1) + |
| 42 | g_tTex2 . Sample(g_sSamp2, 0.2) + |
| 43 | g_tTex3[0] . Sample(g_sSamp3[0], 0.3) + |
| 44 | g_tTex3[1] . Sample(g_sSamp3[1], 0.3) + |
| 45 | g_tTex4[1] . Sample(g_sSamp4[1], 0.4) + |
| 46 | g_tTex4[2] . Sample(g_sSamp4[2], 0.4) + |
| 47 | g_tTex5 . Sample(g_sSamp5, 0.5) + |
| 48 | mystruct.c[1]; |
| 49 | } |
| 50 | |
| 51 | float4 Func2() |
| 52 | { |
| 53 | return |
| 54 | g_tTex1 . Sample(g_sSamp1, 0.1) + |
| 55 | g_tTex3[1] . Sample(g_sSamp3[1], 0.3); |
| 56 | } |
| 57 | |
| 58 | // Not called from entry point: |
| 59 | float4 Func2_unused() |
| 60 | { |
| 61 | return |
| 62 | g_tTex_unused1 . Sample(g_sSamp_unused1, 1.1) + |
| 63 | g_tTex_unused2 . Sample(g_sSamp_unused2, 1.2); |
| 64 | } |
| 65 | |
| 66 | PS_OUTPUT main_ep() |
| 67 | { |
| 68 | PS_OUTPUT psout; |
| 69 | psout.Color = Func1() + Func2(); |
| 70 | return psout; |
| 71 | } |