anchor.diff:  [<AutoOpen>]
   module PreparedPipelineStateAssembler =
       
  +    let private usedClipPlanes (iface : GLSLProgramInterface) =
  +        let candidates = [FShade.ShaderStage.Geometry; FShade.ShaderStage.TessEval; FShade.ShaderStage.Vertex ]
  +        let beforeRasterize = candidates |> List.tryPick (fun s -> MapExt.tryFind s iface.shaders)
  +        match beforeRasterize with
  +        | Some shader ->
  +            match MapExt.tryFind "gl_ClipDistance" shader.shaderBuiltInOutputs with
  +            | Some t ->
  +                let cnt = 
  +                    match t with
  +                    | GLSLType.Array(len,_,_) -> len
  +                    | _ -> 8
  +                Seq.init cnt id |> Set.ofSeq
  +            | None ->
  +                Set.empty
  +        | None ->
  +            Set.empty
  +
       type ICommandStream with
       
           member x.SetPipelineState(s : CompilerInfo, me : PreparedPipelineState) =
  
positive.code:                     else
                          x.Disable(int OpenTK.Graphics.OpenGL4.EnableCap.ProgramPointSize)
              
  
              // bind all uniform-buffers (if needed)
              for (id,ub) in Map.toSeq me.pUniformBuffers do
  
negative.code:                 x.Enable(int OpenTK.Graphics.OpenGL4.EnableCap.ProgramPointSize)
              else
                  x.Disable(int OpenTK.Graphics.OpenGL4.EnableCap.ProgramPointSize)
  
              let meUsed = usedClipPlanes me.pProgramInterface
              for i in meUsed do
                  x.Enable(int OpenTK.Graphics.OpenGL4.EnableCap.ClipDistance0 + i)
              
  
              // bind all uniform-buffers (if needed)
  