Exemple #1
0
        private void CommonInit(int objectByteSize, string materialPropertyName, string materialCountPropertyName, BufferReAllocateStrategy BufferReAllocateStrategy, ComputeBufferType ComputeBufferType)
        {
            this.objectByteSize            = objectByteSize;
            this.materialPropertyName      = materialPropertyName;
            this.materialCountPropertyName = materialCountPropertyName;

            this.BufferReAllocateStrategy = BufferReAllocateStrategy;

            this.customComputeBuffer = new ComputeBuffer(1, objectByteSize, ComputeBufferType);
            this.computeBufferData   = new List <T>();
        }
Exemple #2
0
 public DynamicComputeBufferManager(int objectByteSize, string materialPropertyName, string materialCountPropertyName, MaterialPropertyBlock MaterialPropertyBlock, BufferReAllocateStrategy BufferReAllocateStrategy = BufferReAllocateStrategy.NONE, ComputeBufferType ComputeBufferType = ComputeBufferType.Default)
 {
     this.CommonInit(objectByteSize, materialPropertyName, materialCountPropertyName, BufferReAllocateStrategy, ComputeBufferType);
     this.AbstractDynamicComputeBufferManagerSetter = new MaterialPropertyDynamicComputeBufferManagerSetter <T>(MaterialPropertyBlock);
     this.AbstractDynamicComputeBufferManagerSetter.SetBuffer(this.customComputeBuffer, this.materialPropertyName);
 }