1struct FxaaTex { SamplerState smpl; Texture2D tex; }; 2SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture; 3 4float4 lookUp(FxaaTex tex) 5{ 6 return tex.tex.Sample(tex.smpl, float2(0.3, 0.4)); 7} 8 9FxaaTex fillOpaque() 10{ 11 FxaaTex t; 12 t.smpl = g_tInputTexture_sampler; 13 t.tex = g_tInputTexture; 14 return t; 15} 16 17float4 main() : SV_TARGET0 18{ 19 FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture }; 20 float4 res = lookUp(tex1); 21 FxaaTex tex2 = fillOpaque(); 22 res += lookUp(tex2); 23 FxaaTex tex3 = tex1; 24 res += lookUp(tex3); 25 26 return res; 27} 28