Exemplo n.º 1
0
        private bool TryFastI2mBufferUpdate(ReadOnlySpan <int> commandBuffer, ref int offset)
        {
            if (_state.Method == LoadInlineDataMethodOffset && _state.NonIncrementing && _state.SubChannel <= 2)
            {
                int availableCount = commandBuffer.Length - offset;
                int consumeCount   = Math.Min(_state.MethodCount, availableCount);

                var data = commandBuffer.Slice(offset, consumeCount);

                if (_state.SubChannel == 0)
                {
                    _3dClass.LoadInlineData(data);
                }
                else if (_state.SubChannel == 1)
                {
                    _computeClass.LoadInlineData(data);
                }
                else /* if (_state.SubChannel == 2) */
                {
                    _i2mClass.LoadInlineData(data);
                }

                offset             += consumeCount - 1;
                _state.MethodCount -= consumeCount;

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Pushes a block of data to the Inline-to-Memory engine.
 /// </summary>
 /// <param name="data">Data to push</param>
 public void LoadInlineData(ReadOnlySpan <int> data)
 {
     _i2mClass.LoadInlineData(data);
 }