// Depth of field circle of confusion pass
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// Parameters:
//
//   sampler2D GBufferTextureSampler3;
//   sampler2D HDRSampler;
//   sampler2D DOFBlurSampler;
//   float4 TexelSize;
//   float4 dofBlur;
//   float4 dofDist;
//   float4 dofProj;
//
//
// Registers:
//
//   Name                         Reg   Size
//   ---------------------------- ----- ----
//   TexelSize                    c76      1
//   dofProj                      c77      1
//   dofDist                      c78      1
//   dofBlur                      c79      1
//   GBufferTextureSampler3       s1       1
//   HDRSampler                   s2       1
//   DOFBlurSampler               s8       1
//

    ps_3_0
    def c127, 0.9999999, 1, 0, 0 // LogDepth constants
    def c1, 0, 0.212500006, 0.715399981, 0.0720999986
    def c2, 0.25, 1, 0.5, 0
    def c4, -0.5, -1.5, 1.5, 0.5
    
    dcl_texcoord v0.xy
    dcl_2d s1
    dcl_2d s2
    dcl_2d s8
    texld r0, v0, 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
    // ----------------------------------------------------------------------------------------------------------------------------------------------
    add r0.y, -c77.x, c77.y
    rcp r0.y, r0.y
    mul r0.z, r0.y, c77.y
    mul r0.z, r0.z, -c77.x
    mad r0.x, c77.y, -r0.y, r0.x
    rcp r0.x, r0.x
    
    mov r3, c4
    texld r7.xyz, v0, s2
    
    mad r1.w, r0.z, -r0.x, c78.w // cutscene
    mad r1.w, c78.y, -r3.w, r1.w // cutscene
    max r2.w, r1.w, c1.x // cutscene
    mad r0.x, r0.z, r0.x, -c78.w
    mad r0.x, c78.y, -r3.w, r0.x
    max r1.w, r0.x, c1.x
    rcp r0.x, c78.x // cutscene
    mul r0.x, r2.w, r0.x // cutscene
    lrp r2.w, r0.x, c79.x, c79.y // cutscene
    min r0.x, c79.x, r2.w // cutscene
    rcp r0.z, c78.z
    mul r0.z, r1.w, r0.z
    lrp r1.w, r0.z, c79.z, c79.y
    min r0.z, c79.z, r1.w
    max r0.z, r0.x, r0.z // cutscene
    mul r1.w, r0.z, r0.z
    
    mov r3.xy, c76
    mad r3.xy, r3.xy, c4.w, v0.xy // fix pixel offset
    texld r3, r3, s8
    
    lrp oC0.xyz, r1.w, r3, r7
    mov oC0.w, c2.y

// approximately 176 instruction slots used (14 texture, 162 arithmetic)
