// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed 4a7215de1b00a338-ps.txt
// 3DMigoto: 4a7215de1b00a338 |    Unity headers extracted from VolumetricFogAndMist_CopySunDepth
//    Shader "VolumetricFogAndMist/CopySunDepth" {
//      SubShader 1/6 {
//        Tags { "RenderType"="Opaque" }
//        Pass 1/1 {
//          Tags { "RenderType"="Opaque" }
//          Program "fp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from VolumetricFogAndMist_CopySunDepth:
//   API d3d11
//   Shader model ps_4_0
//   undeciphered1: 201609010 8 0 0
//   undeciphered1a: 1
//   undeciphered2: 1 0 2 0 0 0
//   undeciphered3: 0 0
//   ConstBuffer "$Globals" 48
//   Float 32 [_VF_ShadowBias]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   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:55:08 2019
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float
// TEXCOORD                 0   xyz         1     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[3], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_input_ps linear v1.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 4a7215de1b00a338-ps.txt

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

add r0.xyz, -v1.xyzx, r2.xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
sqrt r0.x, r0.x
add r0.x, r0.x, cb0[2].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