bgfx/3rdparty/glslang/Test/hlsl.flattenOpaqueInit.vert

28 lines
605 B
GLSL
Raw Normal View History

2017-07-16 19:57:18 +03:00
struct FxaaTex { SamplerState smpl; Texture2D tex; };
SamplerState g_tInputTexture_sampler; Texture2D g_tInputTexture;
float4 lookUp(FxaaTex tex)
{
return tex.tex.Sample(tex.smpl, float2(0.3, 0.4));
}
2017-08-26 05:42:26 +03:00
FxaaTex fillOpaque()
{
FxaaTex t;
t.smpl = g_tInputTexture_sampler;
t.tex = g_tInputTexture;
return t;
}
2017-07-16 19:57:18 +03:00
float4 main() : SV_TARGET0
{
2017-08-26 05:42:26 +03:00
FxaaTex tex1 = { g_tInputTexture_sampler, g_tInputTexture };
2017-12-04 05:21:39 +03:00
float4 res = lookUp(tex1);
2017-08-26 05:42:26 +03:00
FxaaTex tex2 = fillOpaque();
2017-12-04 05:21:39 +03:00
res += lookUp(tex2);
2017-10-07 10:52:44 +03:00
FxaaTex tex3 = tex1;
2017-12-04 05:21:39 +03:00
res += lookUp(tex3);
2017-12-10 00:50:23 +03:00
2017-12-04 05:21:39 +03:00
return res;
2017-10-07 10:52:44 +03:00
}