//
// Generated by Microsoft (R) HLSL Shader Compiler 9.29.952.3111
//
// Parameters:
//
//   float4 AspectRatioAndInvAspectRatio;
//   float4 LightShaftParameters;
//   sampler2D SourceTexture;
//   float2 TextureSpaceBlurOrigin;
//   float4 UVMinMax;
//
//
// Registers:
//
//   Name                         Reg   Size
//   ---------------------------- ----- ----
//   TextureSpaceBlurOrigin       c0       1
//   UVMinMax                     c9       1
//   AspectRatioAndInvAspectRatio c10      1
//   LightShaftParameters         c11      1
//   SourceTexture                s0       1
//

    ps_3_0
    def c1, 0, 0.5, 0.015625, 1
    def c2, 0, 2, 1.96875, 4
    def c3, -0.0625, 0, 0, 0
    defi i0, 32, 0, 0, 0
    dcl_texcoord v0.xy
    dcl_2d s0

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


// Unreal light shaft fix inserted with DarkStarSword's shadertool.py:
// shadertool.py -i -f --auto-fix-unreal-light-shafts --only-autofixed --git CRC32_243BCFA3_0.txt
texldl r8, c220.z, s14
mov r7, c0 // TextureSpaceBlurOrigin
mad r7.x, r8.x, c220.w, r7.x // Adjust each eye by 1/2 separation

    mul r0, c10.zwzw, v0.xyxy
    mov r1.zw, c10
    mad r1, v0.xyxy, -r1.zwzw, r7.xyxy
    dp2add r2.x, r1.zwzw, r1.zwzw, c1.x
    rsq r2.x, r2.x
    rcp r2.x, r2.x
    mul r2.x, r2.x, c1.y
    rcp r2.y, r2.x
    mul r1, r1, r2.y
    rsq r2.y, r2.x
    rcp r2.y, r2.y
    mul r2.y, r2.y, c1.y
    min r3.x, r2.x, r2.y
    mul r1, r1, r3.x
    mov r2.z, c1.z
    mul r2.x, r2.z, c11.z
    mul r1, r1, r2.x
    mad r0, r1.zwzw, c1.xxww, r0
    mul r1, r1, c10.xyxy
    mul r0, r0, c10.xyxy
    mov r2, c1.x
    mov r3, r0
    mov r4.xw, c2.yyzz
    rep i0
      mov r4.zw, r4.xyxw
      mul r5.xy, r4.zwzw, r4.zwzw
      mul r5.zw, r5.xyxy, c2.w
      mad r5.xy, r5, c2.w, -r4.zwzw
      cmp r4.xy, r5, r4.zwzw, r5.zwzw
      max r5, r3, c9.xyxy
      min r6, c9.zwzw, r5
      texld r5, r6, s0
      mad r5, r5, r4.xxxz, r2
      texld r6, r6.zwzw, s0
      mad r2, r6, r4.yyyw, r5
      add r4.xw, r4.zyzw, c3.x
      mad r3, r1, c2.y, r3
    endrep
    mul oC0, r2, c1.z

// approximately 43 instruction slots used (2 texture, 41 arithmetic)
