//
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// Parameters:
//
//   sampler2D GBufferTextureSampler3;
//   sampler2D gDeferredLightSampler;
//   float4 gDeferredProjParams;
//   row_major float4x4 gViewInverse;
//   float4 gooDeferredLightScreenSize;
//
//
// Registers:
//
//   Name                       Reg   Size
//   -------------------------- ----- ----
//   gViewInverse               c12      4
//   gooDeferredLightScreenSize c66      1
//   gDeferredProjParams        c72      1
//   gDeferredLightSampler      s0       1
//   GBufferTextureSampler3     s1       1
//

    ps_3_0
    def c219, 1.8395173895e+25, 3.9938258725e+24, 4.5435787456e+30, 4.6242849323e-44 // 33
    def c127, 0.9999999, 1, 0, 0 // LogDepth constants
    def c0, 0.50999999, 0, 0.5, 0
    dcl_color v0
    dcl_texcoord v1.xyw
    dcl_texcoord1 v2
    dcl_texcoord2 v3.xyw
    dcl vPos.xy
    dcl_texcoord9 v9
    dcl_2d s0
    dcl_2d s1
    add r0.xy, c0.x, vPos
    mul r0.xy, r0, c66.zwzw
    texld r0, r0, s1
    // ----------------------------------------------------------------- Log2Linear -----------------------------------------------------------------
    if_ne r0.x, c127.y
      rcp r20.x, c128.x
      mul r20.x, r20.x, c128.y
      pow r20.x, r20.x, r0.x
      mul r20.x, r20.x, c128.x // W_clip
      
      add r20.y, r20.x, -c128.x
      add r20.z, c128.y, -c128.x
      mul r20.y, r20.y, c128.y
      mul r20.z, r20.z, r20.x
      rcp r20.z, r20.z
      mul r20.w, r20.y, r20.z // Linear depth
      
      min r0, r20.w, c127.x // FP error hack
    endif
    // ----------------------------------------------------------------------------------------------------------------------------------------------
    mad r0.x, r0.x, c72.z, -c72.w
    mul r0.x, r0.x, v1.w
    rcp r0.x, r0.x
    mad r0.xy, v1, -r0.x, c15
    add r0.xy, r0, -v3
    dp2add r1.x, v2, r0, c0.y
    dp2add r1.y, v2.zwzw, r0, c0.y
    mul r0.x, c0.z, v3.w
    mad r0.xy, r1, r0.x, c0.z
    texld r0, r0, s0
    mul oC0, r0, v0
    // ----------------------------------------------------------------- Linear2Log -----------------------------------------------------------------
    if_ne v9.y, c127.y
      rcp r20.z, c128.x
      mul r20.x, v9.w, r20.z
      mul r20.y, c128.y, r20.z
      log r20.x, r20.x
      log r20.y, r20.y
      rcp r20.y, r20.y
    else
      mov r20.x, v9.z
      rcp r20.y, v9.w
    endif
    mul oDepth, r20.x, r20.y
    // ----------------------------------------------------------------------------------------------------------------------------------------------

// approximately 16 instruction slots used (2 texture, 14 arithmetic)
