// CRC32: A2804443 |    Unity headers extracted from Internal-PrePassCollectShadows.shader
//    Shader "Hidden/Internal-PrePassCollectShadows" {
//      Properties {
//       _ShadowMapTexture ("", any) = "" { }
//      }
//      Fallback Off
//      SubShader 1/2 {
//        Pass 1/1 {
//          ZTest Always
//          ZWrite Off
//          Cull Off
//          GpuProgramID 23332
//          Program "fp" {
//            SubProgram "d3d9 " {
//              GpuProgramIndex 58
//            }
//          }
//        }
//      }
//    }
//
// Unity 5.3 headers extracted from Internal-PrePassCollectShadows.shader.decompressed:
//   API d3d9
//   Shader model ps_2_0
//   undeciphered1: 29 2 -1
//   Keywords { "SHADOWS_SPLIT_SPHERES" "SHADOWS_NATIVE" "SHADOWS_SINGLE_CASCADE" }
//   undeciphered3: 0 0 1
//   Vector 9 [_LightShadowData]
//   Vector 7 [_ZBufferParams]
//   Vector 8 [unity_OrthoParams]
//   Vector 10 [unity_ShadowFadeCenterAndType]
//   Matrix 0 [_CameraToWorld]
//   Matrix 4 [unity_World2Shadow0] 3
//   SetTexture 0 [_CameraDepthTexture] 2D 0
//   SetTexture 1 [_ShadowMapTexture] 2D 1
//
// Headers extracted with DarkStarSword's extract_unity53_shaders.py
// https://raw.githubusercontent.com/DarkStarSword/3d-fixes/master/extract_unity53_shaders.py

//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//   using 3Dmigoto command line v1.2.38 on Sun Oct 16 02:26:50 2016
//
//
// Parameters:
//
//   sampler2D _CameraDepthTexture;
//   row_major float4x4 _CameraToWorld;
//   float4 _LightShadowData;
//   sampler2D _ShadowMapTexture;
//   float4 _ZBufferParams;
//   float4 unity_OrthoParams;
//   float4 unity_ShadowFadeCenterAndType;
//   row_major float4x4 unity_World2Shadow[4];
//
//
// Registers:
//
//   Name                          Reg   Size
//   ----------------------------- ----- ----
//   _CameraToWorld                c0       4
//   unity_World2Shadow            c4       3
//   _ZBufferParams                c7       1
//   unity_OrthoParams             c8       1
//   _LightShadowData              c9       1
//   unity_ShadowFadeCenterAndType c10      1
//   _CameraDepthTexture           s0       1
//   _ShadowMapTexture             s1       1
//

    ps_3_0 // Converted from ps_2_0 with DarkStarSword's shadertool.py
    def c11, 1, 0, 0, 0
    dcl_texcoord v0.xy
    dcl_texcoord1 v1.xyz
    dcl_texcoord2 v2.xyz
    dcl_texcoord3 v3.xyz
    dcl_2d s0
    dcl_2d s1

def c220, 0, 1, 0.0625, 0.5
dcl_2d s13

texldl r31, c220.z, s13

    texld r0, v0, s0
    mov r1.w, c11.x
    mad r0.y, c7.x, r0.x, c7.y
    rcp r0.y, r0.y
    lrp r2.w, c8.w, r0.x, r0.y
    mov r2.xyz, v2
    add r0.yzw, -r2.wzyx, v3.wzyx
    mad r0.xyz, r0.x, r0.wzyx, v2
    mad r0.xyz, v1, -r2.w, r0
    mul r2.xyz, r2.w, v1
    mad r0.xyz, c8.w, r0, r2
    mov r0.w, c11.x
    dp4 r2.w, c3, r0
    dp4 r2.x, c0, r0
    dp4 r2.y, c1, r0
    dp4 r2.z, c2, r0 // depth in r0.z

// Unity light/shadow fix (pixel shader stage, world-space variant) inserted with DarkStarSword's shadertool.py:
// shadertool.py -i --fix-unity-lighting-ps-world --only-autofixed --ignore-register-errors --ignore-parse-errors --ignore-other-errors dumps\allshaders\pixelshader\A2804443.txt
mov r29, c220.x
add r29.x, r0.z, -r31.y
mul r29.x, r29.x, r31.x
dp4 r28.x, c180, r29
dp4 r28.y, c181, r29
dp4 r28.z, c182, r29
dp4 r28.w, c183, r29
dp4 r29.x, c190, r28
dp4 r29.y, c191, r28
dp4 r29.z, c192, r28
add r2.xyz, r2, -r29

    dp4 r1.x, c4, r2
    dp4 r1.y, c5, r2
    dp4 r1.z, c6, r2
    add r0.xyz, r2, -c10
    dp3 r0.x, r0, r0
    rsq r0.x, r0.x
    rcp r0.x, r0.x
    mad_sat_pp r0.x, r0.x, c9.z, c9.w
    texldp_pp r1, r1, s1
    mov r2.x, c9.x
    add_pp r0.y, -r2.x, c11.x
    mad_pp r0.y, r1.x, r0.y, c9.x
    add_pp r0, r0.x, r0.y
    mov_pp oC0, r0

// approximately 30 instruction slots used (2 texture, 28 arithmetic)
