//Temporal antialiasing (TAA).
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Mon May 24 19:39:38 2021
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Input
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// no Output
cs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[10], immediateIndexed
dcl_constantbuffer cb1[11], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (uint,uint,uint,uint) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_resource_texture2d (float,float,float,float) t3
dcl_uav_typed_texture2d (float,float,float,float) u0
dcl_uav_typed_texture2d (float,float,float,float) u1
dcl_input vThreadGroupID.xy
dcl_input vThreadIDInGroup.xy
dcl_temps 35
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
dcl_tgsm_structured g0, 8, 100
dcl_thread_group 8, 8, 1

ld_indexable(texture2d)(float,float,float,float) r25.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture2d)(float,float,float,float) r26.xyzw, l(2, 0, 0, 0), t120.xyzw

ishl r0.xy, vThreadGroupID.xyxx, l(3, 3, 0, 0)
iadd r0.xy, r0.xyxx, l(-1, -1, 0, 0)
imad r0.z, vThreadIDInGroup.y, l(10), vThreadIDInGroup.x
iadd r1.xy, vThreadIDInGroup.xyxx, r0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyzw, t2.xyzw
mul r2.xyz, r1.xyxx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r2.xy, r2.yyyy, r2.xzxx
mad r0.w, r1.z, l(0.250000), r2.x
dp2 r1.x, r1.xzxx, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r1.y, r1.z, l(-0.250000), r2.y
mad r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
f32tof16 r0.w, r0.w
f32tof16 r1.xy, r1.xyxx
imad r2.x, r1.x, l(0x00010000), r0.w
f32tof16 r0.w, r1.w
imad r2.y, r0.w, l(0x00010000), r1.y
store_structured g0.xy, r0.z, l(0), r2.xyxx
bfi r1.xyzw, l(3, 31, 1, 1), l(0, 0, 0, 0), vThreadIDInGroup.xyxy, l(8, 0, 8, 8)
ige r2.xy, vThreadIDInGroup.xxxx, l(2, 4, 0, 0)
iadd r2.zw, vThreadIDInGroup.yyyx, l(0, 0, 0, 6)
movc r1.xy, r2.xxxx, r2.zwzz, r1.xyxx
movc r1.xy, r2.yyyy, r1.zwzz, r1.xyxx
imad r0.w, r1.y, l(10), r1.x
iadd r1.xy, r1.xyxx, r0.xyxx
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyzw, t2.xyzw
mul r2.xyz, r1.xyxx, l(0.250000, 0.500000, -0.250000, 0.000000)
add r0.xy, r2.yyyy, r2.xzxx
mad r0.x, r1.z, l(0.250000), r0.x
dp2 r1.x, r1.xzxx, l(0.500000, -0.500000, 0.000000, 0.000000)
mad r1.y, r1.z, l(-0.250000), r0.y
mad r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
f32tof16 r0.x, r0.x
f32tof16 r1.xy, r1.xyxx
imad r0.x, r1.x, l(0x00010000), r0.x
f32tof16 r1.x, r1.w
imad r0.y, r1.x, l(0x00010000), r1.y
store_structured g0.xy, r0.w, l(0), r0.xyxx
sync_g_t
imad r1.xy, vThreadGroupID.xyxx, l(8, 8, 0, 0), vThreadIDInGroup.xyxx
itof r0.xy, r1.xyxx
add r0.xy, r0.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mul r2.xy, r0.xyxx, cb0[5].zwzz
iadd r3.xyzw, r0.zzzz, l(11, 1, 2, 10)
ld_structured r2.zw, r3.x, l(0), g0.xxxy
ushr r4.xy, r2.zwzz, l(16, 16, 0, 0)
f16tof32 r5.xz, r2.zzwz
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(uint,uint,uint,uint) r0.w, r1.xyww, t1.yzwx
ld_structured r2.z, r3.x, l(0), g0.xxxx
ushr r2.z, r2.z, l(16)
f16tof32 r5.y, r2.z
f16tof32 r4.xy, r4.yxyy
ld_structured r2.zw, r0.z, l(0), g0.xxxy
ushr r6.xy, r2.zwzz, l(16, 16, 0, 0)
f16tof32 r7.xz, r2.zzwz
f16tof32 r7.yw, r6.xxxy
ld_structured r2.zw, r3.y, l(0), g0.xxxy
ushr r3.xy, r2.zwzz, l(16, 16, 0, 0)
f16tof32 r6.xz, r2.zzwz
f16tof32 r6.yw, r3.xxxy
add r8.xyz, r5.xyzx, r7.xyzx
add r8.xyz, r6.xyzx, r8.xyzx
min r9.xyzw, r6.xyzw, r7.xyzw
mov r5.w, r4.x
min r9.xyzw, r5.xyzw, r9.xyzw
max r6.xyzw, r6.xyzw, r7.xyzw
max r6.xyzw, r5.xyzw, r6.xyzw
ld_structured r2.zw, r3.z, l(0), g0.xxxy
ushr r3.xy, r2.zwzz, l(16, 16, 0, 0)
f16tof32 r7.xz, r2.zzwz
f16tof32 r7.yw, r3.xxxy
ld_structured r2.zw, r3.w, l(0), g0.xxxy
ushr r3.xy, r2.zwzz, l(16, 16, 0, 0)
f16tof32 r10.xz, r2.zzwz
f16tof32 r10.yw, r3.xxxy
add r3.xyz, r7.xyzx, r8.xyzx
add r3.xyz, r10.xyzx, r3.xyzx
min r8.xyzw, r7.xyzw, r10.xyzw
min r8.xyzw, r8.xyzw, r9.xyzw
max r7.xyzw, r7.xyzw, r10.xyzw
max r6.xyzw, r6.xyzw, r7.xyzw
iadd r7.xyzw, r0.zzzz, l(12, 20, 21, 22)
ld_structured r2.zw, r7.x, l(0), g0.xxxy
ushr r5.yw, r2.zzzw, l(0, 16, 0, 16)
f16tof32 r9.xz, r2.zzwz
f16tof32 r9.yw, r5.yyyw
ld_structured r2.zw, r7.y, l(0), g0.xxxy
ushr r5.yw, r2.zzzw, l(0, 16, 0, 16)
f16tof32 r10.xz, r2.zzwz
f16tof32 r10.yw, r5.yyyw
add r3.xyz, r3.xyzx, r9.xyzx
add r3.xyz, r10.xyzx, r3.xyzx
min r11.xyzw, r9.xyzw, r10.xyzw
min r8.xyzw, r8.xyzw, r11.xyzw
max r9.xyzw, r9.xyzw, r10.xyzw
max r6.xyzw, r6.xyzw, r9.xyzw
ld_structured r2.zw, r7.z, l(0), g0.xxxy
ushr r5.yw, r2.zzzw, l(0, 16, 0, 16)
f16tof32 r9.xz, r2.zzwz
f16tof32 r9.yw, r5.yyyw
ld_structured r2.zw, r7.w, l(0), g0.xxxy
ushr r5.yw, r2.zzzw, l(0, 16, 0, 16)
f16tof32 r7.xz, r2.zzwz
f16tof32 r7.yw, r5.yyyw
add r3.xyz, r3.xyzx, r9.xyzx
add r3.xyz, r7.xyzx, r3.xyzx
min r10.xyzw, r7.xyzw, r9.xyzw
min r8.xyzw, r8.xyzw, r10.xyzw
max r7.xyzw, r7.xyzw, r9.xyzw
max r6.xyzw, r6.xyzw, r7.xyzw
mul r7.xyz, r3.xyzx, l(0.111111112, 0.111111112, 0.111111112, 0.000000)
mul r2.yz, r2.xxyx, cb0[8].xxyx
and r9.xyz, r0.wwww, l(0x00003fff, 0x20000000, 0x10000000, 0)
utof r0.z, r9.x
mul r10.x, r0.z, cb1[10].z
ubfe r0.z, l(13), l(14), r0.w
utof r0.z, r0.z
mul r10.y, r0.z, cb1[10].w
mul r2.x, r2.y, cb0[9].x
add r2.yw, r10.xxxy, l(0.000000, -0.500000, 0.000000, -0.500000)
mad r2.xy, r2.ywyy, l(0.250000, 0.250000, 0.000000, 0.000000), r2.xzxx
mul r2.xy, r2.xyxx, cb0[8].zwzz
if_nz cb0[7].y
  div r2.zw, l(1.000000, 1.000000, 1.000000, 1.000000), cb0[6].xxxy
  mad r5.yw, r2.xxxy, cb0[6].xxxy, l(0.000000, -0.500000, 0.000000, -0.500000)
  round_ni r5.yw, r5.yyyw
  add r5.yw, r5.yyyw, l(0.000000, 0.500000, 0.000000, 0.500000)
  mad r9.xw, r2.yyyx, cb0[6].yyyx, -r5.wwwy
  mul r10.xy, r9.wxww, r9.wxww
  mul r10.zw, r9.wwwx, r10.xxxy
  mad r11.xy, r10.yxyy, r9.xwxx, r9.xwxx
  mad r11.xy, -r11.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000), r10.yxyy
  mul r11.zw, r10.yyyx, l(0.000000, 0.000000, 2.500000, 2.500000)
  mad r10.zw, r10.wwwz, l(0.000000, 0.000000, 1.500000, 1.500000), -r11.zzzw
  add r10.zw, r10.zzzw, l(0.000000, 0.000000, 1.000000, 1.000000)
  mad r9.xw, r10.xxxy, r9.wwwx, -r10.xxxy
  mul r10.xy, r9.xwxx, l(0.500000, 0.500000, 0.000000, 0.000000)
  add r11.zw, -r11.yyyx, l(0.000000, 0.000000, 1.000000, 1.000000)
  add r11.zw, -r10.wwwz, r11.zzzw
  mad r9.xw, -r9.xxxw, l(0.500000, 0.000000, 0.000000, 0.500000), r11.zzzw
  add r10.zw, r9.wwwx, r10.zzzw
  div r9.xw, r9.xxxw, r10.wwwz
  add r9.xw, r5.yyyw, r9.xxxw
  mul r12.zw, r2.zzzw, r5.yyyw
  mul r12.xy, r2.zwzz, r9.xwxx
  sample_l_aoffimmi_indexable(-1,-1,0)(texture2d)(float,float,float,float) r13.xyzw, r12.zwzz, t3.xyzw, s0, l(0.000000)
  mul r0.z, r11.x, r11.y
  sample_l_aoffimmi_indexable(0,-1,0)(texture2d)(float,float,float,float) r14.xyzw, r12.xwxx, t3.xyzw, s0, l(0.000000)
  mul r2.zw, r11.xxxy, r10.wwwz
  mul r14.xyzw, r2.zzzz, r14.xyzw
  mad r13.xyzw, r13.xyzw, r0.zzzz, r14.xyzw
  sample_l_aoffimmi_indexable(2,-1,0)(texture2d)(float,float,float,float) r14.xyzw, r12.zwzz, t3.xyzw, s0, l(0.000000)
  mul r5.yw, r11.xxxy, r10.xxxy
  mad r11.xyzw, r14.xyzw, r5.yyyy, r13.xyzw
  sample_l_aoffimmi_indexable(-1,0,0)(texture2d)(float,float,float,float) r13.xyzw, r12.zyzz, t3.xyzw, s0, l(0.000000)
  mad r11.xyzw, r13.xyzw, r2.wwww, r11.xyzw
  sample_l_aoffimmi_indexable(0,0,0)(texture2d)(float,float,float,float) r13.xyzw, r12.xyxx, t3.xyzw, s0, l(0.000000)
  mul r0.z, r10.z, r10.w
  mad r11.xyzw, r13.xyzw, r0.zzzz, r11.xyzw
  sample_l_aoffimmi_indexable(2,0,0)(texture2d)(float,float,float,float) r13.xyzw, r12.zyzz, t3.xyzw, s0, l(0.000000)
  mul r2.zw, r10.zzzw, r10.xxxy
  mad r11.xyzw, r13.xyzw, r2.zzzz, r11.xyzw
  sample_l_aoffimmi_indexable(-1,2,0)(texture2d)(float,float,float,float) r13.xyzw, r12.zwzz, t3.xyzw, s0, l(0.000000)
  mad r11.xyzw, r13.xyzw, r5.wwww, r11.xyzw
  sample_l_aoffimmi_indexable(0,2,0)(texture2d)(float,float,float,float) r13.xyzw, r12.xwxx, t3.xyzw, s0, l(0.000000)
  mad r11.xyzw, r13.xyzw, r2.wwww, r11.xyzw
  sample_l_aoffimmi_indexable(2,2,0)(texture2d)(float,float,float,float) r12.xyzw, r12.zwzz, t3.xyzw, s0, l(0.000000)
  mul r0.z, r10.y, r10.x
  mad r10.xyzw, r12.xyzw, r0.zzzz, r11.xyzw
else
  sample_l_indexable(texture2d)(float,float,float,float) r10.xyzw, r2.xyxx, t3.xyzw, s0, l(0.000000)
endif
mad r2.xy, r0.xyxx, cb0[5].zwzz, -r2.xyxx

//Original
//movc r0.z, cb0[7].x, l(1), l(0)

//Custom. TAA disabled.
if_nz r26.z
movc r0.z, cb0[7].x, l(0), l(0)
else
movc r0.z, cb0[7].x, l(1), l(0)
endif

movc r2.z, r0.w, l(1), l(0)
and r0.z, r0.z, r2.z
ushr r0.w, r0.w, l(30)
ieq r2.z, r0.w, l(0)
ine r5.yw, r9.yyyz, l(0, 0, 0, 0)
not r2.w, r5.y
and r2.z, r2.w, r2.z
or r2.z, r2.z, r5.w
ieq r2.w, r2.z, l(0)
ieq r3.w, r5.y, l(-1)
and r2.w, r2.w, r3.w
max r9.xzw, r8.xxyz, r10.xxyz
min r9.xzw, r6.xxyz, r9.xxzw
mul r2.xy, r2.xyxx, l(-1920.000000, -1080.000000, 0.000000, 0.000000)
dp2 r2.x, r2.xyxx, r2.xyxx
exp r2.x, -r2.x
add r2.x, -r2.x, l(1.250000)
movc r2.y, r2.w, l(0.500000), l(1.000000)
mad r2.x, r2.x, r2.y, r8.w

//Original.
movc r7.xyz, r0.zzzz, r10.xyzx, r7.xyzx

//Custom 1.
//mov r7.xyz, r10.xyzx

mov r4.zw, r5.zzzx
movc r5.yzw, r0.wwww, r7.xxyz, r4.wwyz
max_sat r2.y, r2.x, r10.w
add r7.xyz, -r5.yzwy, r9.xzwx
mad r5.yzw, r2.yyyy, r7.xxyz, r5.yyzw
eq r2.y, r6.w, l(1.000000)
eq r2.w, r10.w, l(1.000000)
or r2.w, r2.w, r2.y
movc r2.w, r2.w, l(0.800000), l(0.900000)
movc r2.w, r0.w, r2.w, l(0)
add r3.w, -r8.x, r6.x
add r3.w, -r3.w, l(1.000000)
mul r3.w, r3.w, r3.w

//Custom. Sharpening disabled.
if_nz r26.w
mov r0.w, l(0)
else
movc r0.w, r0.w, l(1.000000), l(0)
movc r0.w, r9.y, l(2.000000), r0.w
endif

mul r0.w, r0.w, cb0[7].z
mul r0.w, r2.w, r0.w
dp2_sat r0.w, r0.wwww, r3.wwww
mul r0.w, r0.w, l(0.250000)
mad r3.w, -r3.x, l(0.111111112), r5.x
mad_sat r3.w, r3.w, l(4.000000), r5.x
add r3.w, -r5.x, r3.w
mad r4.x, r0.w, r3.w, r5.x
and r0.w, r2.z, cb0[7].w
mad r3.xyz, r3.xyzx, l(0.111111112, 0.111111112, 0.111111112, 0.000000), -r4.xyzx
mad r3.xyz, r0.wwww, r3.xyzx, r4.xyzx
movc r0.z, r0.z, r2.w, l(0)
add r4.xyz, -r3.xyzx, r5.yzwy
mad r4.xyz, r0.zzzz, r4.xyzx, r3.xyzx
add r6.xyz, -r5.yzwy, r4.xyzx
lt r6.xyz, l(0.000000, 0.000000, 0.000000, 0.000000), r6.xyzx
movc r6.xyz, r6.xyzx, l(0.00146484375,0.00146484375,0.00146484375,0), l(-0.00146484375,-0.00146484375,-0.00146484375,0)
add r5.xyz, r5.yzwy, r6.xyzx
add r6.xyz, r4.xyzx, -r5.xyzx
add r7.xyz, r3.xyzx, -r4.xyzx
add r8.xyz, r6.xyzx, r7.xyzx
mul r8.xyz, -r6.xyzx, r8.xyzx
ge r8.xyz, r8.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
mul r6.xyz, r6.xyzx, r7.xyzx
ge r6.xyz, r6.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
movc r3.xyz, r6.xyzx, r4.xyzx, r3.xyzx
movc r3.xyz, r8.xyzx, r5.xyzx, r3.xyzx
if_nz cb0[9].y
  ld_indexable(texture2d)(float,float,float,float) r4.xyz, r1.xyww, t3.xyzw
  add r5.xyz, r3.xyzx, -r4.xyzx
  mad r4.xyz, r5.yzxy, l(0.150000, 0.150000, 0.150000, 0.000000), r4.yzxy
  mov r3.w, l(1.000000)
else
  movc r3.w, r2.y, l(1.000000), r2.x
  mov r4.xyz, r3.yzxy
endif
mad r0.zw, r4.yyyx, l(0.000000, 0.000000, 2.000000, 2.000000), l(0.000000, 0.000000, -1.000000, -1.000000)
add r2.yz, r0.wwzw, r4.zzzz
add r2.x, -r0.z, r2.y
add r0.w, -r0.w, r4.z
add r2.w, -r0.z, r0.w
mad r0.zw, r0.xxxy, cb0[5].zzzw, cb0[0].xxxy
mad r0.z, r0.w, l(543.309998), r0.z
sincos r0.z, null, r0.z
mul r0.z, r0.z, l(493013.000000)
frc r0.z, r0.z
mad r0.z, r0.z, cb0[1].x, cb0[1].y
mul r2.xyzw, r0.zzzz, r2.xzwx
store_uav_typed u1.xyzw, r1.xyyy, r3.xyzw
mad r0.xy, r0.xyxx, cb0[6].zwzz, l(-0.500000, -0.500000, 0.000000, 0.000000)
dp2 r0.x, r0.xyxx, r0.xyxx
add r0.x, -r0.x, l(0.500000)
mul r0.x, r0.x, -cb0[3].x
exp r0.x, r0.x
mul_sat r0.x, r0.x, cb0[3].y
mul r2.xyzw, r2.xyzw, r2.xyzw
mad r0.y, -r0.x, cb0[2].w, cb0[2].w
mul r0.x, r0.x, r0.x
mul r0.x, r0.x, cb0[2].w
mad r2.xyzw, r2.xyzw, r0.yyyy, cb0[2].xyzx
mad r0.xyzw, cb0[4].xyzx, r0.xxxx, r2.xyzw
ld_indexable(texture2d)(float,float,float,float) r2.xyzw, r1.xyzw, t0.xyzw
add r1.z, -r2.w, l(1.000000)
mad r0.xyzw, r0.xyzw, r1.zzzz, r2.xyzx
mul r2.xyzw, r0.wyzw, l(12.920000, 12.920000, 12.920000, 12.920000)
max r0.xyzw, r0.xyzw, l(0.00313066994, 0.00313066994, 0.00313066994, 0.00313066994)
log r0.xyzw, r0.xyzw
mul r0.xyzw, r0.xyzw, l(0.416666657, 0.416666657, 0.416666657, 0.416666657)
exp r0.xyzw, r0.xyzw
mad r0.xyzw, r0.xyzw, l(1.055000, 1.055000, 1.055000, 1.055000), l(-0.055000, -0.055000, -0.055000, -0.055000)
min r0.xyzw, r0.xyzw, r2.xyzw
store_uav_typed u0.xyzw, r1.xyyy, r0.xyzw
ret
// Approximately 0 instruction slots used
