unsafe public void MarkAsFinished(int count = -1)
        {
            int actualCount = count == -1 ? Length : Math.Min(count, Length);

            ProceduralVirtualTexturing.MarkRequestsFinished(owner.handle, (IntPtr)requests.GetUnsafeReadOnlyPtr(), actualCount);
            Length = 0;
        }
 public void BindToMaterialPropertyBlock(MaterialPropertyBlock mpb)
 {
     if (mpb == null)
     {
         throw new ArgumentNullException("mbp");
     }
     ProceduralVirtualTexturing.BindToMaterialPropertyBlock(handle, mpb, name);
 }
 public void Dispose()
 {
     requests.Dispose();
     if (IsValid())
     {
         ProceduralVirtualTexturing.Destroy(handle);
     }
 }
 public void BindToMaterial(Material mat)
 {
     if (mat == null)
     {
         throw new ArgumentNullException("mat");
     }
     ProceduralVirtualTexturing.BindToMaterial(handle, mat, name);
 }
 public ProceduralTextureStack(string _name, ProceduralTextureStackCreationParams creationParams)
 {
     name = _name;
     creationParams.borderSize = borderSize;
     creationParams.Validate();
     requests = new ProceduralRequestList(creationParams, this);
     handle   = ProceduralVirtualTexturing.Create(creationParams);
 }
 public void InvalidateRegion(Rect r, int mipMap, int numMips)
 {
     if (IsValid() == false)
     {
         throw new InvalidOperationException("Invalid ProceduralTextureStack");
     }
     ProceduralVirtualTexturing.InvalidateRegion(handle, r, mipMap, numMips);
 }
        unsafe public void Apply()
        {
            if (requestUpdates.Count == 0)
            {
                return;
            }

            ProceduralVirtualTexturing.UpdateRequestStates(owner.handle, requestUpdates.ToArray());

            requestUpdates.Clear();
        }
 public void BindToMaterial(Material mat)
 {
     if (mat == null)
     {
         throw new ArgumentNullException("mat");
     }
     if (IsValid() == false)
     {
         throw new InvalidOperationException("Invalid ProceduralTextureStack");
     }
     ProceduralVirtualTexturing.BindToMaterial(handle, mat, name);
 }
 public void BindToMaterialPropertyBlock(MaterialPropertyBlock mpb)
 {
     if (mpb == null)
     {
         throw new ArgumentNullException("mbp");
     }
     if (IsValid() == false)
     {
         throw new InvalidOperationException("Invalid ProceduralTextureStack");
     }
     ProceduralVirtualTexturing.BindToMaterialPropertyBlock(handle, mpb, name);
 }
        public void BindGlobally()
        {
            if (IsValid() == false)
            {
                throw new InvalidOperationException("Invalid ProceduralTextureStack {name}");
            }
            bool success = ProceduralVirtualTexturing.BindGlobally(handle, name);

            if (!success)
            {
                throw new InvalidOperationException($"ProceduralTextureStack {name} is not fully initialized on the render thread and cannot bind globally. Please try again next frame.");
            }
        }
        public void BindToMaterial(Material mat)
        {
            if (mat == null)
            {
                throw new ArgumentNullException("mat");
            }
            if (IsValid() == false)
            {
                throw new InvalidOperationException("Invalid ProceduralTextureStack {name}");
            }
            bool success = ProceduralVirtualTexturing.BindToMaterial(handle, mat, name);

            if (!success)
            {
                throw new InvalidOperationException($"ProceduralTextureStack {name} is not fully initialized on the render thread and cannot bind to a Material. Please try again next frame.");
            }
        }
 public void InvalidateRegion(Rect r, int mipMap, int numMips)
 {
     ProceduralVirtualTexturing.InvalidateRegion(handle, r, mipMap, numMips);
 }
 public void RequestRegion(Rect r, int mipMap, int numMips)
 {
     ProceduralVirtualTexturing.RequestRegion(handle, r, mipMap, numMips);
 }
 unsafe public void MarkAllRequestsFinished()
 {
     ProceduralVirtualTexturing.MarkAllRequestsFinished(owner.handle, (IntPtr)requests.GetUnsafeReadOnlyPtr(), Length);
     Length = 0;
 }
 public void BindGlobally()
 {
     ProceduralVirtualTexturing.BindGlobally(handle, name);
 }
 public void Dispose()
 {
     requests.Dispose();
     ProceduralVirtualTexturing.Destroy(handle);
 }
 unsafe internal void Sync()
 {
     Length = ProceduralVirtualTexturing.GetActiveRequests(owner.handle, (IntPtr)requests.GetUnsafePtr());
 }