Assets/Plugins/Unity.DSPGraph/Runtime/DSPNodeImplementation.cs
/// <summary>
/// Set up "native" job data for execution
/// </summary>
/// <param name="graph">The graph to which this node belongs</param>
/// <param name="unsafeGraphBuffer">A pointer to the global graph array (burst!)</param>
Set up "native" job data for execution
Set up " native " job data for execution
internal void PrepareJobData(DSPGraph graph, DSPGraph* unsafeGraphBuffer)
        {
            JobDataBuffer->NativeJobData.GraphRegistry = unsafeGraphBuffer;
            JobDataBuffer->NativeJobData.GraphIndex = graph.Handle.Id;
            JobDataBuffer->NativeJobData.NodeIndex = Handle.Id;
            JobDataBuffer->NativeJobData.DSPClock = (ulong)graph.DSPClock;
            JobDataBuffer->NativeJobData.DSPBufferSize = (uint)graph.DSPBufferSize;
            JobDataBuffer->NativeJobData.SampleRate = (uint)graph.SampleRate;
            JobDataBuffer->NativeJobData.SampleReadCount = (uint)graph.LastReadLength;
            JobDataBuffer->NativeJobData.ParameterKeys = graph.ParameterKeys.UnsafeDataPointer;
            bool isRoot = Equals(graph.RootDSP);
            float* floatBufferStart = isRoot ? graph.RootBuffer.UnsafeDataPointer : JobDataBuffer->Buffer;
            float* floatCursor = floatBufferStart;
            SetupPortBuffers(graph, graph.LastReadLength, &floatCursor);
            SetupParameters();
            SetupSampleProviders();
        }
internal void PrepareJobData ( DSPGraph graph , DSPGraph * unsafeGraphBuffer ) { JobDataBuffer -> NativeJobData . GraphRegistry = unsafeGraphBuffer ; JobDataBuffer -> NativeJobData . GraphIndex = graph . Handle . Id ; JobDataBuffer -> NativeJobData . NodeIndex = Handle . Id ; JobDataBuffer -> NativeJobData . DSPClock = ( ulong ) graph . DSPClock ; JobDataBuffer -> NativeJobData . DSPBufferSize = ( uint ) graph . DSPBufferSize ; JobDataBuffer -> NativeJobData . SampleRate = ( uint ) graph . SampleRate ; JobDataBuffer -> NativeJobData . SampleReadCount = ( uint ) graph . LastReadLength ; JobDataBuffer -> NativeJobData . ParameterKeys = graph . ParameterKeys . UnsafeDataPointer ; bool isRoot = Equals ( graph . RootDSP ) ; float * floatBufferStart = isRoot ? graph . RootBuffer . UnsafeDataPointer : JobDataBuffer -> Buffer ; float * floatCursor = floatBufferStart ; SetupPortBuffers ( graph , graph . LastReadLength , & floatCursor ) ; SetupParameters ( ) ; SetupSampleProviders ( ) ; }
Set up "native" job data for execution
Set up " native " job data for execution
graph
DSPGraph
The graph to which this node belongs
The graph to which this node belongs
unsafeGraphBuffer
DSPGraph*
A pointer to the global graph array (burst!)
A pointer to the global graph array ( burst! )