// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed 9209d6bf350809f0-ps.txt
// 3DMigoto: 9209d6bf350809f0 |    Unity headers extracted from VolumetricFogAndMist_CopySunDepth
//    Shader "VolumetricFogAndMist/CopySunDepth" {
//      SubShader 2/6 {
//        Tags { "RenderType"="TransparentCutout" }
//        Pass 1/1 {
//          Tags { "RenderType"="TransparentCutout" }
//          Program "fp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from VolumetricFogAndMist_CopySunDepth:
//   API d3d11
//   Shader model ps_4_0
//   undeciphered1: 201609010 10 1 0
//   undeciphered1a: 1
//   undeciphered2: 1 1 2 1 0 0
//   undeciphered3: 0 0
//   ConstBuffer "$Globals" 80
//   Float 32 [_Cutoff]
//   Vector 48 [_Color]
//   Float 64 [_VF_ShadowBias]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   SetTexture 0 [_MainTex] 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 Apr 21 17:59:00 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xy          1     NONE   float   xy
// TEXCOORD                 1   xyz         2     NONE   float   xyz
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_4_0
dcl_constantbuffer cb0[5], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_input_ps linear v2.xyz
dcl_output o0.xyzw
dcl_temps 3
dcl_constantbuffer cb10[4], immediateIndexed

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

ld_indexable(texture2d)(float,float,float,float) r1.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 9209d6bf350809f0-ps.txt

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

sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mad r0.x, r0.w, cb0[3].w, -cb0[2].x
lt r0.x, r0.x, l(0.000000)
discard_nz r0.x
add r0.xyz, -v2.xyzx, r2.xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
sqrt r0.x, r0.x
add r0.x, r0.x, cb0[4].x
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
mul r0.xyzw, r0.xxxx, l(1.000000, 255.000000, 65025.000000, 16581375.000000)
frc r0.xyzw, r0.xyzw
mad o0.xyzw, -r0.yzww, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886), r0.xyzw
ret
// Approximately 0 instruction slots used