// asmtool.py -I ../.. --fix-unity-reflection --only-autofixed 63e42875df557e9a-ps.txt
// 3DMigoto: 63e42875df557e9a |    Unity headers extracted from PF_Decals_SnowGlobalDecal
//    Shader "PF/Decals/SnowGlobalDecal" {
//      SubShader 1/1 {
//        Pass 1/1 {
//          ZWrite Off
//          Program "fp" {
//            SubProgram "d3d11" {
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from PF_Decals_SnowGlobalDecal:
//   API d3d11
//   Shader model ps_4_0
//   undeciphered1: 201708220 18 4 0
//   undeciphered1a: 3
//   undeciphered2: 1 3 2 3 0 0
//   undeciphered3: 0 0
//   ConstBuffer "$Globals" 2416
//   Vector 64 [_Color]
//   Vector 96 [_MainTex_ST]
//   Float 2396 [_SlopePower]
//   Float 2400 [_ScatterPower]
//   Float 2404 [_ScatterThreshold]
//   ConstBuffer "UnityPerCamera" 144
//   Vector 64 [_WorldSpaceCameraPos] 3
//   Vector 112 [_ZBufferParams]
//   SetTexture 0 [_CameraDepthTexture] 2D 20
//   SetTexture 1 [_CameraNormalsTex] 2D 10
//   SetTexture 2 [_MainTex] 2D 00
//   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.2 on Mon Jan 14 18:29:37 2019
//
//
// 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[151], immediateIndexed
dcl_constantbuffer cb1[9], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t2
dcl_input_ps linear v0.xy
dcl_input_ps linear v1.xz
dcl_output o0.xyzw
dcl_temps 5
dcl_constantbuffer cb10[4], immediateIndexed

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

ld_indexable(texture2d)(float,float,float,float) r3.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 63e42875df557e9a-ps.txt

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

sample r0.xyzw, v0.xyxx, t1.xyzw, s1
mad r0.xyz, r0.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r0.x, r0.xyzx, r0.xyzx
rsq r0.x, r0.x
mul r0.x, r0.x, r0.y
mul_sat r0.x, r0.x, cb0[149].w
sample r1.xyzw, v0.xyxx, t0.xyzw, s2
mad r0.y, cb1[7].z, r1.x, cb1[7].w
div r0.y, l(1.000000, 1.000000, 1.000000, 1.000000), r0.y
mad r1.xyzw, v1.xzxz, r0.yyyy, r4.xzxz
mad r1.xyzw, r1.xyzw, cb0[6].xyxy, cb0[6].zwzw
mul r1.xyzw, r1.xyzw, l(0.020000, 0.020000, 0.500000, 0.500000)
sample r2.xyzw, r1.zwzz, t2.xyzw, s0
sample r1.xyzw, r1.xyxx, t2.xyzw, s0
mad r0.y, r1.x, r2.y, l(-0.700000)
mul o0.xyz, r1.xyzx, cb0[4].xyzx
add r0.y, r0.y, -cb0[150].y
mul r0.y, r0.y, cb0[150].x
mul r0.x, r0.x, r0.y
log r0.x, r0.x
mul r0.x, r0.x, cb0[150].x
exp o0.w, r0.x
ret
// Approximately 0 instruction slots used