//Temporal ambient occlusion.
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Mon May 24 18:26:57 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[1], immediateIndexed
dcl_constantbuffer cb1[11], immediateIndexed
dcl_constantbuffer cb2[4], 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_input vThreadIDInGroup.y
dcl_input vThreadID.xy
dcl_temps 35
dcl_resource_texture1d (float,float,float,float) t120
dcl_resource_texture2d (float,float,float,float) t125
dcl_tgsm_structured g0, 4, 128
dcl_tgsm_structured g1, 16, 128
dcl_thread_group 1, 64, 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
ld_indexable(texture2d)(float,float,float,float) r27.xyzw, l(4, 0, 0, 0), t120.xyzw

iadd r0.xyzw, vThreadID.xyxy, l(0, 32, 0, -32)
mov r1.xy, r0.zwzz
mov r1.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.x, r1.xyww, t0.xyzw

mov r20.x, r2.x

mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r2.y, r0.xyww, t0.yxzw
store_structured g0.x, vThreadIDInGroup.y, l(0), r2.x
iadd r2.z, vThreadIDInGroup.y, l(64)
store_structured g0.x, r2.z, l(0), r2.y
lt r2.x, l(0.001000), r2.x
ld_indexable(texture2d)(float,float,float,float) r1.xyzw, r1.xyzw, t2.xyzw
and r1.xyzw, r1.xyzw, r2.xxxx
store_structured g1.xyzw, vThreadIDInGroup.y, l(0), r1.xyzw
lt r1.x, l(0.001000), r2.y
ld_indexable(texture2d)(float,float,float,float) r0.xyzw, r0.xyzw, t2.xyzw
and r0.xyzw, r0.xyzw, r1.xxxx
store_structured g1.xyzw, r2.z, l(0), r0.xyzw
sync_g_t
iadd r0.x, vThreadIDInGroup.y, l(32)
ld_structured r0.y, r0.x, l(0), g0.xxxx
lt r0.z, l(0.001000), r0.y
if_nz r0.z
  ld_structured r1.xyzw, r0.x, l(0), g1.xyzw
  mov r2.xyzw, r1.xyzw
  mov r0.zw, l(0,0,1.000000,4.000000)
  mov r3.x, l(1)
  loop
    ige r3.y, r3.x, l(8)
    breakc_nz r3.y
    iadd r3.y, r0.x, -r3.x
    ld_structured r3.z, r3.y, l(0), g0.xxxx
    iadd r3.w, r0.x, r3.x
    ld_structured r4.x, r3.w, l(0), g0.xxxx
    add r3.z, -r0.y, r3.z
    add r4.x, r0.y, -r4.x
    add r3.z, |r3.z|, -|r4.x|
    div r3.z, |r3.z|, r0.y
    mad r3.z, -r3.z, l(256.000000), l(0.900000)
    max r3.z, r3.z, l(0.000000)
    mul r0.w, r0.w, r3.z
    eq r3.z, r0.w, l(0.000000)
    if_nz r3.z
      break
    endif
    mad r0.z, r0.w, l(2.000000), r0.z
    ld_structured r4.xyzw, r3.y, l(0), g1.xyzw
    mov_sat r4.xyzw, r4.xyzw
    mad r4.xyzw, r4.xyzw, r0.wwww, r2.xyzw
    ld_structured r5.xyzw, r3.w, l(0), g1.xyzw
    mov_sat r5.xyzw, r5.xyzw
    mad r2.xyzw, r5.xyzw, r0.wwww, r4.xyzw
    iadd r3.x, r3.x, l(1)
  endloop
else
  mov r2.xyzw, l(0,0,0,-1.000000)
  mov r0.z, l(1.000000)
endif
div r0.xyzw, r2.xyzw, r0.zzzz
utof r1.xy, vThreadID.xyxx
add r1.xy, r1.xyxx, l(0.500000, 0.500000, 0.000000, 0.000000)
mov r2.x, cb2[2].z
mov r2.y, cb2[3].w
ge r1.z, r0.w, l(0.000000)
itof r2.zw, vThreadID.xxxy

//mul r25.w, cb1[10].z, l(1000.25)
//mad r2.z, r25.x, r25.w, r2.z

add r2.zw, r2.zzzw, l(0.000000, 0.000000, 0.500000, 0.500000)
mul r3.xz, r2.xxyx, r2.zzwz

//mul r25.w, r25.y, r20.x
//div r25.w, r25.w, l(1280.0)
//mad r3.x, r25.x, r25.w, r3.x

mov r4.xy, vThreadID.xyxx
mov r4.zw, l(0,0,0,0)

//add r4.x, r25.x, r4.x

ld_indexable(texture2d)(uint,uint,uint,uint) r1.w, r4.xyzw, t1.yzwx

//mad r3.x, r25.x, r1.w, r3.x

ine r2.z, cb0[0].x, l(0)
ushr r2.w, r1.w, l(30)




ieq r2.w, r2.w, l(0)
ieq r2.w, r2.w, l(0)

//Custom. TAA disabled.
if_nz r27.w
mov r2.w, l(0)
//store_uav_typed u0.xyzw, vThreadID.xyyy, l(0.0)
//ret
endif

and r3.yw, r1.wwww, l(0, 0x20000000, 0, 0x00003fff)
ine r3.y, r3.y, l(0)
or r2.w, r2.w, r3.y
and r2.z, r2.w, r2.z
mul r2.w, r3.x, cb0[0].z
utof r3.y, r3.w
mul r4.x, r3.y, cb1[10].z
ubfe r1.w, l(13), l(14), r1.w
utof r1.w, r1.w
mul r4.y, r1.w, cb1[10].w
mul r3.x, r2.w, cb0[0].y
add r3.yw, r4.xxxy, l(0.000000, -0.500000, 0.000000, -0.500000)
mad r3.xy, r3.ywyy, l(0.250000, 0.250000, 0.000000, 0.000000), r3.xzxx
mad r1.xy, -r1.xyxx, r2.xyxx, r3.xyxx
dp2 r1.x, r1.xyxx, r1.xyxx
mul r1.x, r1.x, l(-2048.000000)
exp r1.x, r1.x

//mad r3.x, r25.x, l(-0.0025), r3.x

//mul r25.w, r3.w, l(-0.25)
//mad r3.x, r25.x, r25.w, r3.x


sample_l_indexable(texture2d)(float,float,float,float) r3.xyzw, r3.xyxx, t3.xyzw, s0, l(0.000000)
mul r1.x, r1.x, l(0.850000)
and r1.x, r1.x, r2.z
add r2.xyzw, -r0.xyzw, r3.xyzw
mad r0.xyzw, r1.xxxx, r2.xyzw, r0.xyzw
and r0.xyzw, r0.xyzw, r1.zzzz
store_uav_typed u0.xyzw, vThreadID.xyyy, r0.xyzw
ret
// Approximately 0 instruction slots used
