private void InitializeBuffers(Primitive p) { instanceData[p] = new InstanceData(); InstanceType[] a = new InstanceType[MAX_INSTANCES_PER_BUFFER]; a.Initialize(); instanceData[p].Instances = a.ToList(); instanceData[p].InstanceCount = 0; instanceData[p].DeletedInstances = new List <int>(); instanceData[p].InstanceBuffer = ToDispose(SharpDX.Toolkit.Graphics.Buffer.New(device, a, BufferFlags.VertexBuffer, ResourceUsage.Dynamic)); toAdd[p] = new List <int>(); toModify[p] = new List <int>(); toRemove[p] = new List <int>(); }