//Mission symbol Bright Memory
//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sat May 14 20:23:15 2022
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// ATTRIBUTE                0   xyzw        0     NONE   float   xyz
// ATTRIBUTE               13   x           1     NONE    uint   x
// SV_VertexID              0   x           2   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                10   xyzw        0     NONE   float   xyzw
// TEXCOORD                11   xyzw        1     NONE   float   xyzw
// TEXCOORD                 0   xyzw        2     NONE   float   xyzw
// PRIMITIVE_ID             0   x           3     NONE    uint   x
// TEXCOORD                 7   xyzw        4     NONE   float   xyzw
// SV_POSITION              0   xyzw        5      POS   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb0[115], immediateIndexed
dcl_constantbuffer cb1[211], immediateIndexed
dcl_constantbuffer cb2[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texturecube (float,float,float,float) t0
dcl_resource_structured t1, 16
dcl_resource_buffer (float,float,float,float) t2
dcl_resource_buffer (float,float,float,float) t3
dcl_input v0.xyz
dcl_input v1.x
dcl_input_sgv v2.x, vertex_id
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw
dcl_output o3.x
dcl_output o4.xyzw
dcl_output_siv o5.xyzw, position
dcl_temps 36
dcl_resource_texture2d (float,float,float,float) t125
dcl_resource_texture1d (float,float,float,float) t120
ld_indexable(texture2d)(float,float,float,float) r33.xyzw, l(0, 0, 0, 0), t125.xyzw
ld_indexable(texture1d)(float,float,float,float) r32.xyzw, l(90, 0, 0, 0), t120.xyzw

iadd r0.x, v2.x, cb2[0].w
ishl r0.y, r0.x, l(1)
ld_indexable(buffer)(float,float,float,float) r0.yzw, r0.yyyy, t3.wxyz
bfi r1.x, l(31), l(1), r0.x, l(1)
ld_indexable(buffer)(float,float,float,float) r1.xyzw, r1.xxxx, t3.xyzw
mul r2.xyz, r0.yzwy, r1.yzxy
mad r0.yzw, r1.xxyz, r0.zzwy, -r2.xxyz
mul r0.yzw, r1.wwww, r0.yyzw
mul r2.xyz, r1.yzxy, r0.yzwy
mad r0.yzw, r0.wwyz, r1.zzxy, -r2.xxyz
mul r0.yzw, r1.wwww, r0.yyzw
imul null, r2.x, v1.x, l(36)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r2.xyz, r2.x, l(0), t1.xyzx
imad r3.xy, v1.xxxx, l(36, 36, 0, 0), l(1, 3, 0, 0)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r3.xzw, r3.x, l(0), t1.xxyz
imad r2.w, v1.x, l(36), l(2)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r4.xyz, r2.w, l(0), t1.xyzx
imad r2.w, v1.x, l(36), l(4)
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r5.xyzw, r2.w, l(0), t1.xyzw
mul r6.xyz, r2.xyzx, r5.xxxx
mul r7.xyz, r3.xzwx, r5.yyyy
mul r5.xyz, r4.xyzx, r5.zzzz
mul r8.xyz, r0.zzzz, r7.xyzx
mad r8.xyz, r0.yyyy, r6.xyzx, r8.xyzx
mad o0.xyz, r0.wwww, r5.xyzx, r8.xyzx
mul r0.yzw, r1.yyyy, r7.xxyz
mad r0.yzw, r1.xxxx, r6.xxyz, r0.yyzw
mad o1.xyz, r1.zzzz, r5.xyzx, r0.yzwy
mul o1.w, r1.w, r5.w
ld_structured_indexable(structured_buffer, stride=16)(mixed,mixed,mixed,mixed) r0.yzw, r3.y, l(0), t1.xxyz
mul r1.xyz, r3.xzwx, v0.yyyy
mad r1.xyz, r2.xyzx, v0.xxxx, r1.xyzx
mad r1.xyz, r4.xyzx, v0.zzzz, r1.xyzx
add r0.yzw, r0.yyzw, cb1[70].xxyz
add r0.yzw, r0.yyzw, r1.xxyz
imul null, r0.x, r0.x, cb2[0].y
ld_indexable(buffer)(float,float,float,float) r1.xy, r0.xxxx, t2.xyzw
mul r2.xyzw, r0.zzzz, cb1[1].xyzw
mad r2.xyzw, r0.yyyy, cb1[0].xyzw, r2.xyzw
mad r2.xyzw, r0.wwww, cb1[2].xyzw, r2.xyzw
//add o5.xyzw, r2.xyzw, cb1[3].xyzw
//output instructions done in atemp register because output is read only but can be rewritten later
add r30.xyzw, r2.xyzw, cb1[3].xyzw

//convergence
//1,00//40,00/140,00/600,00
//correction value
//0,989/0,966/0,9000/
//correction formula calculated based on this by linear regression
//y = -0,00076633258384225500x + 0,99712643699520000000


//if PS for target symbol is ALSO active, x32 will become 5.0, done in AutoDepthUIHUD.ini by shader override
ieq r31.x, r32.x, l(5.0)
if_nz r31.x
//stereo correction, calculation for correction value needed because not 100% convergence scaling formula, this is allways fulldepth without correction value calculated
add r33.w, r30.w, -r33.y
mul r33.w, r30.w, r33.x
//correction value calculated based on y = formula above
mad r31.y, r33.y, l(-0.000766332583842255), l(0.9971264369952)

mul r33.w, r33.w, r31.y
add r30.x, r30.x, r33.w
endif
//move modded original instruction back to apply fix
mov o5.xyzw, r30.xyzw



add r0.xyz, r0.yzwy, -cb1[68].xyzx
dp3 r1.z, r0.xyzx, r0.xyzx
sqrt r1.z, r1.z
dp3 r1.w, r0.xyzx, cb1[60].xyzx
div r1.z, r1.z, r1.w
mul r1.z, r1.z, cb1[210].z
max r1.z, r1.z, l(0.000000)
min r1.w, cb0[107].z, cb1[67].z
add r2.x, -r1.w, cb1[67].z
add r0.w, r0.z, r2.x
dp3 r0.z, r0.xywx, r0.xywx
rsq r2.x, r0.z
mul r0.z, r0.z, r2.x
max r1.z, r1.z, cb0[107].w
lt r2.y, l(0.000000), r1.z
mul r2.z, r2.x, r1.z
mad r1.w, r2.z, r0.w, r1.w
mad r2.z, -r2.z, r0.w, r0.w
mad r1.z, -r1.z, r2.x, l(1.000000)
mul r1.z, r0.z, r1.z
add r2.w, r1.w, -cb0[110].y
mul r2.w, r2.w, cb0[107].y
max r2.w, r2.w, l(-127.000000)
exp r2.w, -r2.w
mul r2.w, r2.w, cb0[110].x
add r1.w, r1.w, -cb0[108].w
mul r1.w, r1.w, cb0[108].y
max r1.w, r1.w, l(-127.000000)
exp r1.w, -r1.w
mul r1.w, r1.w, cb0[108].z
movc r2.w, r2.y, r2.w, cb0[107].x
movc r1.w, r2.y, r1.w, cb0[108].x
movc r1.z, r2.y, r1.z, r0.z
movc r2.y, r2.y, r2.z, r0.w
mul r2.z, r2.y, cb0[107].y
max r2.z, r2.z, l(-127.000000)
exp r3.x, -r2.z
add r3.x, -r3.x, l(1.000000)
div r3.x, r3.x, r2.z
mad r3.y, -r2.z, l(0.240226507), l(0.693147182)
lt r2.z, l(0.010000), |r2.z|
movc r2.z, r2.z, r3.x, r3.y
mul r2.y, r2.y, cb0[108].y
max r2.y, r2.y, l(-127.000000)
exp r3.x, -r2.y
add r3.x, -r3.x, l(1.000000)
div r3.x, r3.x, r2.y
mad r3.y, -r2.y, l(0.240226507), l(0.693147182)
lt r2.y, l(0.010000), |r2.y|
movc r2.y, r2.y, r3.x, r3.y
mul r1.w, r1.w, r2.y
mad r1.w, r2.w, r2.z, r1.w
mul r2.y, r1.z, r1.w
lt r2.zw, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[110].zzzw
if_nz r2.z
  mad_sat r2.z, r0.z, cb0[114].x, cb0[114].y
  mul r3.xy, cb0[113].yxyy, l(1.000000, -1.000000, 0.000000, 0.000000)
  dp2 r3.x, r0.xyxx, r3.xyxx
  dp2 r3.y, r0.xyxx, cb0[113].xyxx
  mov r3.z, r0.w
  sample_l_indexable(texturecube)(float,float,float,float) r4.xyz, r3.xyzx, t0.xyzw, s0, l(0.000000)
  sample_l_indexable(texturecube)(float,float,float,float) r3.xyz, r3.xyzx, t0.xyzw, s0, cb0[114].z
  add r4.xyz, -r3.xyzx, r4.xyzx
  mad r3.xyz, r2.zzzz, r4.xyzx, r3.xyzx
  mul r3.xyz, r3.xyzx, cb0[109].xyzx
else
  mov r3.xyz, cb0[109].xyzx
endif
ge r2.z, cb0[111].w, l(0.000000)
eq r3.w, cb0[110].z, l(0.000000)
and r2.z, r2.z, r3.w
if_nz r2.z
  mul r0.xyw, r0.xyxw, r2.xxxx
  dp3_sat r0.x, r0.xywx, cb0[111].xyzx
  log r0.x, r0.x
  mul r0.x, r0.x, cb0[112].w
  exp r0.x, r0.x
  mul r0.xyw, r0.xxxx, cb0[112].xyxz
  add r1.z, r1.z, -cb0[111].w
  max r1.z, r1.z, l(0.000000)
  mul r1.z, r1.z, r1.w
  exp r1.z, -r1.z
  min r1.z, r1.z, l(1.000000)
  add r1.z, -r1.z, l(1.000000)
  mul r4.xyz, r0.xywx, r1.zzzz
else
  mov r4.xyz, l(0,0,0,0)
endif
exp r0.x, -r2.y
min r0.x, r0.x, l(1.000000)
max r4.w, r0.x, cb0[109].w
lt r0.x, cb0[110].w, r0.z
and r0.x, r0.x, r2.w
movc r0.xyzw, r0.xxxx, l(0,0,0,1.000000), r4.xyzw
add r1.z, -r0.w, l(1.000000)
mad o4.xyz, r3.xyzx, r1.zzzz, r0.xyzx
mov o0.w, l(0)
mov o2.xy, r1.xyxx
mov o2.zw, l(0,0,0,0)
mov o4.w, r0.w
mov o3.x, v1.x
ret
