// Stipple filter + custom mask
// Generated by Microsoft (R) HLSL Shader Compiler 9.26.952.2844
//
// Parameters:
//
//   sampler2D HDRSampler;
//   sampler2D StencilCopySampler;
//   float4 TexelSize;
//
//
// Registers:
//
//   Name                         Reg   Size
//   ---------------------------- ----- ----
//   TexelSize                    c76      1
//   HDRSampler                   s2       1
//   StencilCopySampler           s7       1
//

    ps_3_0
    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 s2
    dcl_2d s0
    
    mov r3, c4
    mad r4, c76.xyxy, r3.xyzx, v0.xyxy
    mad r6, c76.xyxy, r3.wzyw, v0.xyxy
    texld r7.xyz, v0, s2
    texld r3.xyz, r4.xy, s2
    texld r4.xyz, r4.zw, s2
    texld r5.xyz, r6.xy, s2
    texld r6.xyz, r6.zw, s2
    
    dp3 r0.x, r7, c1.yzww
    dp3 r8.x, r3, c1.yzww
    dp3 r8.y, r4, c1.yzww
    dp3 r8.z, r5, c1.yzww
    dp3 r8.w, r6, c1.yzww
    dp4 r0.z, r8, c2.x
    add r8, r8, -r0.z
    dp4 r2.w, r8, r8
    add r0.x, r0.x, -r0.z
    mad r0.x, r0.x, r0.x, -r2.w
    cmp r0.x, r0.x, c2.y, c2.w
    
    mov r31, c2.w
    if_ne r31.x, c223.z // Stipple mask
      mov r21, c76
      texld r22, v0, s0
      mad r21, r21.xyxy, c2.yyww, v0.xyxy
      texldl r23, r21.xw, s0
      add r22.w, r22, r23
      texldl r23, r21.zy, s0
      add r22.w, r22, r23
      texldl r23, r21.xy, s0
      add_sat r22.w, r22, r23
      mul r0.x, r0.x, r22.w
    endif
    
    add r3.xyz, r3, r4
    add r3.xyz, r3, r5
    add r3.xyz, r3, r6
    mul r3.xyz, r3, c2.x
    lrp oC0.xyz, r0.x, r3, r7
    mov oC0.w, c2.y

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