1 2SamplerState g_sSamp1 : register(s0); 3SamplerState g_sSamp2; 4SamplerState g_sSamp3[2] : register(s2); 5SamplerState g_sSamp4[3]; 6SamplerState g_sSamp5; 7 8SamplerState g_sSamp_unused1; 9SamplerState g_sSamp_unused2; 10 11Texture1D g_tTex1 : register(t1); 12const uniform Texture1D g_tTex2; 13Texture1D g_tTex3[2] : register(t3); 14Texture1D g_tTex4[3]; 15Texture1D g_tTex5; 16 17Texture1D g_tTex_unused1 : register(t0); 18Texture1D g_tTex_unused2 : register(t2); 19Texture1D g_tTex_unused3; 20 21struct MyStruct_t { 22 int a; 23 float b; 24 float3 c; 25}; 26 27uniform MyStruct_t mystruct : register(b4); 28 29struct PS_OUTPUT 30{ 31 float4 Color : SV_Target0; 32}; 33 34uniform float4 myfloat4_a; 35uniform float4 myfloat4_b; 36uniform int4 myint4_a; 37 38float4 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 51float4 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: 59float4 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 66PS_OUTPUT main_ep() 67{ 68 PS_OUTPUT psout; 69 psout.Color = Func1() + Func2(); 70 return psout; 71} 72