Пример #1
0
    public void ReleaseBuffers()
    {
        if (CurrentComputeBuffer != null)
        {
            CurrentComputeBuffer.Release();
            CurrentComputeBuffer = null;
        }

        if (PreviousComputeBuffer != null)
        {
            PreviousComputeBuffer.Release();
            PreviousComputeBuffer = null;
        }
    }
Пример #2
0
    public bool TryAllocateComputeBuffersWithValues(
        ElementType[] initialElementValues)
    {
        bool result = false;

        if (TryAllocateComputeBuffersWithGarbage(initialElementValues.Length))
        {
            CurrentComputeBuffer.SetData(initialElementValues);
            PreviousComputeBuffer.SetData(initialElementValues);

            result = true;
        }

        return(result);
    }