//Temporal antialiasing (TAA).
// ---- Created with 3Dmigoto v1.3.16 on Wed May 26 17:53:54 2021
Texture3D<float4> t5 : register(t5);

Texture2D<uint4> t4 : register(t4);

Texture2D<float4> t3 : register(t3);

Texture2D<float4> t2 : register(t2);

Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s2_s : register(s2);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb3 : register(b3)
{
  float4 cb3[1];
}

cbuffer cb2 : register(b2)
{
  float4 cb2[3];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[44];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[7];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  linear noperspective float4 v0 : TEXCOORD0,
  linear noperspective float4 v1 : TEXCOORD1,
  float4 v2 : TEXCOORD2,
  linear noperspective float4 v3 : TEXCOORD3,
  float4 v4 : SV_POSITION0,
  out float4 o0 : SV_Target0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.x = t1.Sample(s2_s, v3.zw).x;
  r0.y = t1.Sample(s2_s, v3.xy).y;
  r0.z = t1.Sample(s2_s, v0.xy).z;
  
  //o0.xyz=r0.xyz;
  //o0.w=1;
  //return;
  
  r0.xyz = cb1[43].zzz * r0.xyz;
  r0.xyz = max(float3(0,0,0), r0.xyz);
  r0.xyz = log2(r0.xyz);
  r0.xyz = cb0[3].xyz * r0.xyz;
  r0.xyz = exp2(r0.xyz);
  r0.xyz = cb1[43].yyy * r0.xyz;
  r1.xy = -cb2[1].xy + v4.xy;
  r1.xy = cb2[2].zw * r1.xy;
  r1.xy = r1.xy * float2(2,-2) + float2(-1,1);
  r1.xy = r1.xy * cb0[4].zw + cb0[4].xy;
  r1.xy = r1.xy * float2(0.5,-0.5) + float2(0.5,0.5);
  r2.xyz = t0.Sample(s1_s, r1.xy).xyz;
  r2.xyz = r2.xyz * cb3[0].xyz + cb0[1].xyz;
  r3.xyz = t2.Sample(s0_s, r1.xy).xyz;
  r1.xyz = t3.SampleLevel(s0_s, r1.xy, 0).xyz;
  r2.xyz = r3.xyz * r2.xyz;
  r0.xyz = r0.xyz * cb0[0].xyz + r2.xyz;
  r0.xyz = v1.xxx * r0.xyz;
  r0.xyz = r0.xyz * r1.xxx;
  r1.xw = cb0[2].xx * v1.yz;
  r0.w = dot(r1.xw, r1.xw);
  r0.w = 1 + r0.w;
  r0.w = rcp(r0.w);
  r0.w = r0.w * r0.w;
  r0.xyz = r0.xyz * r0.www;
  r0.w = max(9.99999997e-007, r0.x);
  r1.x = max(r0.y, r0.z);
  r0.w = max(r1.x, r0.w);
  r1.x = exp2(-r0.w);
  r1.x = 1 + -r1.x;
  r0.w = r0.w / r1.x;
  r0.xyz = r0.xyz / r0.www;
  r0.w = r0.w + r0.w;
  r0.xyz = sqrt(r0.xyz);
  r0.xyz = r0.xyz * float3(0.96875,0.96875,0.96875) + float3(0.015625,0.015625,0.015625);
  r0.xyz = t5.SampleLevel(s0_s, r0.xyz, 0).xyz;
  r2.xyz = r0.xyz * r0.xyz;
  r1.x = dot(r2.xyz, float3(0.300000012,0.589999974,0.109999999));
  r0.xyz = -r0.xyz * r0.xyz + r1.xxx;
  r3.xyz = cb0[6].xyz * r0.xyz;
  r1.x = dot(r3.xyz, r3.xyz);
  r1.x = -cb0[5].y * r1.x;
  r1.x = exp2(r1.x);
  r3.xy = (uint2)v4.xy;
  r3.zw = float2(0,0);
  r1.w = t4.Load(r3.xyz).y;
  r3.xyz = (int3)r1.www & int3(15,64,16);
  r4.xy = cmp((int2)r3.xx == int2(3,7));
  r1.w = (int)r4.y | (int)r4.x;
  r1.w = r1.w ? -0 : -cb0[5].x;
  r1.x = r1.x * r1.w;
  r0.xyz = r1.xxx * r0.xyz + r2.xyz;
  r0.xyz = r0.xyz * r0.www;
  r2.xyz = exp2(-r0.xyz);
  r0.xyz = saturate(r0.xyz);
  r2.xyz = -r2.xyz * r1.yyy + r1.yyy;
  r0.w = 1 + -r1.y;
  r1.xy = cmp(float2(0.25,0.75) < r1.zz);
  r0.xyz = saturate(r0.xyz * r0.www + r2.xyz);
  o0.xyz = sqrt(r0.xyz);
  r0.x = (int)r1.x | (int)r4.x;
  r0.yz = cmp((int2)r3.yz != int2(0,0));
  r0.x = (int)r0.y | (int)r0.x;
  r0.y = (int)r0.z | (int)r1.y;
  r0.xy = r0.xy ? float2(0.5,1) : 0;
  r0.x = r0.x + r0.y;
  o0.w = r3.x ? r0.x : 0.5;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Wed May 26 17:53:54 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// TEXCOORD                 1   xyz         1     NONE   float   xyz
// TEXCOORD                 2   xyzw        2     NONE   float
// TEXCOORD                 3   xyzw        3     NONE   float   xyzw
// SV_POSITION              0   xyzw        4      POS   float   xy
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[7], immediateIndexed
dcl_constantbuffer cb1[44], immediateIndexed
dcl_constantbuffer cb2[3], immediateIndexed
dcl_constantbuffer cb3[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (uint,uint,uint,uint) t4
dcl_resource_texture3d (float,float,float,float) t5
dcl_input_ps linear noperspective v0.xy
dcl_input_ps linear noperspective v1.xyz
dcl_input_ps linear noperspective v3.xyzw
dcl_input_ps_siv linear noperspective v4.xy, position
dcl_output o0.xyzw
dcl_temps 5
sample_indexable(texture2d)(float,float,float,float) r0.x, v3.zwzz, t1.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r0.y, v3.xyxx, t1.xyzw, s2
sample_indexable(texture2d)(float,float,float,float) r0.z, v0.xyxx, t1.xyzw, s2
mul r0.xyz, r0.xyzx, cb1[43].zzzz
max r0.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
log r0.xyz, r0.xyzx
mul r0.xyz, r0.xyzx, cb0[3].xyzx
exp r0.xyz, r0.xyzx
mul r0.xyz, r0.xyzx, cb1[43].yyyy
add r1.xy, v4.xyxx, -cb2[1].xyxx
mul r1.xy, r1.xyxx, cb2[2].zwzz
mad r1.xy, r1.xyxx, l(2.000000, -2.000000, 0.000000, 0.000000), l(-1.000000, 1.000000, 0.000000, 0.000000)
mad r1.xy, r1.xyxx, cb0[4].zwzz, cb0[4].xyxx
mad r1.xy, r1.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r1.xyxx, t0.xyzw, s1
mad r2.xyz, r2.xyzx, cb3[0].xyzx, cb0[1].xyzx
sample_indexable(texture2d)(float,float,float,float) r3.xyz, r1.xyxx, t2.xyzw, s0
sample_l_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t3.xyzw, s0, l(0.000000)
mul r2.xyz, r2.xyzx, r3.xyzx
mad r0.xyz, r0.xyzx, cb0[0].xyzx, r2.xyzx
mul r0.xyz, r0.xyzx, v1.xxxx
mul r0.xyz, r1.xxxx, r0.xyzx
mul r1.xw, v1.yyyz, cb0[2].xxxx
dp2 r0.w, r1.xwxx, r1.xwxx
add r0.w, r0.w, l(1.000000)
rcp r0.w, r0.w
mul r0.w, r0.w, r0.w
mul r0.xyz, r0.wwww, r0.xyzx
max r0.w, r0.x, l(0.000001)
max r1.x, r0.z, r0.y
max r0.w, r0.w, r1.x
exp r1.x, -r0.w
add r1.x, -r1.x, l(1.000000)
div r0.w, r0.w, r1.x
div r0.xyz, r0.xyzx, r0.wwww
add r0.w, r0.w, r0.w
sqrt r0.xyz, r0.xyzx
mad r0.xyz, r0.xyzx, l(0.968750, 0.968750, 0.968750, 0.000000), l(0.015625, 0.015625, 0.015625, 0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r0.xyz, r0.xyzx, t5.xyzw, s0, l(0.000000)
mul r2.xyz, r0.xyzx, r0.xyzx
dp3 r1.x, r2.xyzx, l(0.300000, 0.590000, 0.110000, 0.000000)
mad r0.xyz, -r0.xyzx, r0.xyzx, r1.xxxx
mul r3.xyz, r0.xyzx, cb0[6].xyzx
dp3 r1.x, r3.xyzx, r3.xyzx
mul r1.x, r1.x, -cb0[5].y
exp r1.x, r1.x
ftou r3.xy, v4.xyxx
mov r3.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r1.w, r3.xyzw, t4.xzwy
and r3.xyz, r1.wwww, l(15, 64, 16, 0)
ieq r4.xy, r3.xxxx, l(3, 7, 0, 0)
or r1.w, r4.y, r4.x
movc r1.w, r1.w, l(-0.000000), -cb0[5].x
mul r1.x, r1.w, r1.x
mad r0.xyz, r1.xxxx, r0.xyzx, r2.xyzx
mul r0.xyz, r0.wwww, r0.xyzx
exp r2.xyz, -r0.xyzx
mov_sat r0.xyz, r0.xyzx
mad r2.xyz, -r2.xyzx, r1.yyyy, r1.yyyy
add r0.w, -r1.y, l(1.000000)
lt r1.xy, l(0.250000, 0.750000, 0.000000, 0.000000), r1.zzzz
mad_sat r0.xyz, r0.xyzx, r0.wwww, r2.xyzx
sqrt o0.xyz, r0.xyzx
or r0.x, r1.x, r4.x
ine r0.yz, r3.yyzy, l(0, 0, 0, 0)
or r0.x, r0.y, r0.x
or r0.y, r0.z, r1.y
and r0.xy, r0.xyxx, l(0x3f000000, 0x3f800000, 0, 0)
add r0.x, r0.y, r0.x
movc o0.w, r3.x, r0.x, l(0.500000)
ret
// Approximately 0 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
