// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed 8d710f76d219d536-ps.txt
// 3DMigoto: 8d710f76d219d536 |    Unity headers extracted from Hidden_ScreenSpaceFogOfWar
//    Shader "Hidden/ScreenSpaceFogOfWar" {
//      SubShader 1/1 {
//        Pass 1/1 {
//          ZWrite Off
//          Program "fp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Hidden_ScreenSpaceFogOfWar:
//   API d3d11
//   Shader model ps_4_0
//   undeciphered1: 201802150 12 1 3
//   undeciphered1a: 2
//   undeciphered2: 1 2 2 2 0 0
//   undeciphered3: 0 0
//   ConstBuffer "$Globals" 2400
//   Vector 192 [_FogOfWarMask_ST]
//   Vector 224 [_FogOfWarColor]
//   Float 240 [_FogOfWarGlobalFlag]
//   Float 2396 [_ScreenSpaceFowMaxDistance]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   Vector 80 [_ProjectionParams]
//   Vector 112 [_ZBufferParams]
//   SetTexture 0 [_CameraDepthTexture] 2D 1
//   SetTexture 1 [_FogOfWarMask] 2D 0
//   BindCB "$Globals" 0
//   BindCB "UnityPerCamera" 1
//
// Headers extracted with DarkStarSword's extract_unity55_shaders.py
// https://github.com/DarkStarSword/3d-fixes

//
// Generated by Microsoft (R) D3D Shader Disassembler
//
//   using 3Dmigoto v1.3.16 on Sun Aug 23 06:49:34 2020
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// TEXCOORD                 0   xy          0     NONE   float   xy
// TEXCOORD                 1   xyz         1     NONE   float   x z
// SV_POSITION              0   xyzw        2      POS   float
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[150], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps linear v0.xy
dcl_input_ps linear v1.xz
dcl_output o0.xyzw
dcl_temps 4
dcl_constantbuffer cb10[4], immediateIndexed

// 3DMigoto StereoParams:
dcl_resource_texture2d (float,float,float,float) t125

ld_indexable(texture2d)(float,float,float,float) r2.xyzw, l(0, 0, 0, 0), t125.xyzw


// Unity reflection/specular fix inserted with DarkStarSword's asmtool.py:
// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed 8d710f76d219d536-ps.txt

mul r2.w, -r2.x, r2.y
mad r3.xyz, -r2.wwww, cb10[0].xyzw, cb1[4].xyzw

ne r0.x, l(0.000000, 0.000000, 0.000000, 0.000000), cb0[15].x
if_nz r0.x
  sample r0.xyzw, v0.xyxx, t0.xyzw, s1
  mad r0.x, cb1[7].z, r0.x, cb1[7].w
  div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
  mad r0.yz, v1.xxzx, r0.xxxx, r3.xxzx
  mad r0.yz, r0.yyzy, cb0[12].xxyx, cb0[12].zzwz
  sample_l r1.xyzw, r0.yzyy, t1.xyzw, s0, l(0.000000)
  mul r0.y, r1.y, cb0[14].w
  max r0.y, r0.y, r1.x
  add r0.z, -r1.z, l(1.000000)
  mul_sat r0.y, r0.z, r0.y
  mul r0.z, cb0[149].w, cb1[5].z
  lt r0.x, r0.z, r0.x
  movc r0.x, r0.x, l(1.000000), r0.y
  mul o0.xyz, r0.xxxx, cb0[14].xyzx
  add o0.w, -r0.x, l(1.000000)
  ret
else
  mov o0.xyzw, l(0,0,0,0)
  ret
endif
ret
// Approximately 0 instruction slots used