public void releaseTemporaryBuffers() { if (null != ShownVoxelCount) { ShownVoxelCount.Release(); } ShownVoxelCount = null; if (null != ShownVoxelOffset) { ShownVoxelOffset.Release(); } ShownVoxelOffset = null; if (null != ShownVoxels) { ShownVoxels.Release(); } ShownVoxels = null; if (null != TotalVoxelCount) { TotalVoxelCount.Release(); } TotalVoxelCount = null; }
public void callFaceCopyKernel() { int[] totalfaceblocks = new int[1]; TotalVoxelCount.GetData(totalfaceblocks); totalShownVoxelCount = totalfaceblocks[0]; if (null != SolidVoxels) { releaseSolidVoxels(); } SolidVoxels = new ComputeBuffer(totalfaceblocks[0], sizeof(int)); meshGen.SetBuffer(FaceCopyKernel, "SolidVoxels", SolidVoxels); meshGen.Dispatch(FaceCopyKernel, 8, 1, 8); }