anchor.diff:              )
   
           member x.Create(data : IBuffer) =
  -            let shared = get data
  -            shared.Acquire()
  -            shared :> Buffer
  +            if active then
  +                let shared = get data
  +                shared.Acquire()
  +                shared :> Buffer
  +            else
  +                ctx.CreateBuffer data
   
           member x.Update(b : Buffer, data : IBuffer) : Buffer =
  -            match b with
  -                | :? RefCountedBuffer as b ->
  +            if active then
  +                match b with
  +                    | :? RefCountedBuffer as b ->
                       
  -                    let newShared = get data
  -                    if newShared = b then
  -                        b :> Buffer
  -                    else
  -                        newShared.Acquire()
  -                        b.Release()
  -                        newShared :> Buffer
  -                | _ ->
  -                    ctx.Upload(b, data)
  -                    b
  +                        let newShared = get data
  +                        if newShared = b then
  +                            b :> Buffer
  +                        else
  +                            newShared.Acquire()
  +                            b.Release()
  +                            newShared :> Buffer
  +                    | _ ->
  +                        ctx.Upload(b, data)
  +                        b
  +            else
  +                ctx.Upload(b, data)
  +                b
   
           member x.Delete(b : Buffer) =
  -            match b with
  -                | :? RefCountedBuffer as b -> b.Release()
  -                | _ -> ctx.Delete b
  -
  -    type ArrayBufferManager(ctx : Context) =
  +            if active then
  +                match b with
  +                    | :? RefCountedBuffer as b -> b.Release()
  +                    | _ -> ctx.Delete b
  +            else
  +                ctx.Delete b
  +
  +    type ArrayBufferManager(ctx : Context, active : bool) =
           let cache = ConcurrentDictionary<Array, RefCountedBuffer>()
   
           let get (b : Array) =
  
positive.code:                 x.Handle <- 0
  
  
      type BufferManager(ctx : Context) =
          let cache = ConcurrentDictionary<IBuffer, RefCountedBuffer>()
  
          let get (b : IBuffer) =
  
negative.code:             )
  
          member x.Create(data : Array) =
              if active then
                  let shared = get data
                  shared.Acquire()
                  shared :> Buffer
              else
                  ctx.CreateBuffer data
  
          member x.Update(b : Buffer, data : Array) : Buffer =
              if active then
                  match b with
                      | :? RefCountedBuffer as b ->
                      
                          let newShared = get data
                          if newShared = b then
                              b :> Buffer
                          else
                              newShared.Acquire()
                              b.Release()
                              newShared :> Buffer
                      | _ ->
                          ctx.Upload(b, data)
                          b
              else
                  ctx.Upload(b, data)
                  b
  
          member x.Delete(b : Buffer) =
              if active then
                  match b with
                      | :? RefCountedBuffer as b -> b.Release()
                      | _ -> ctx.Delete b
              else
                  ctx.Delete b
  
      type TextureManager(ctx : Context, active : bool) =
          let cache = ConcurrentDictionary<ITexture, RefCountedTexture>()
  
          let get (b : ITexture) =
              cache.GetOrAdd(b, fun v -> 
                  RefCountedTexture(
                      ctx,
                      (fun () -> ctx.CreateTexture b),
                      (fun () -> cache.TryRemove b |> ignore)
                  )
              )
  
          member x.Create(data : ITexture) =
              if active then
                  let shared = get data
                  shared.Acquire()
                  shared :> Texture
              else
                  ctx.CreateTexture data
  
          member x.Update(b : Texture, data : ITexture) : Texture =
              if active then
                  match b with
                      | :? RefCountedTexture as b ->
                      
                          let newShared = get data
                          if newShared = b then
                              b :> Texture
                          else
                              newShared.Acquire()
                              b.Release()
                              newShared :> Texture
                      | _ ->
                          ctx.Upload(b, data)
                          b
              else
                  ctx.Upload(b, data)
                  b
  
          member x.Delete(b : Texture) =
              if active then
                  match b with
                      | :? RefCountedTexture as b -> b.Release()
                      | _ -> ctx.Delete b
              else
                  ctx.Delete b
  
  
  
  