/// <summary> /// Launches Inline-to-Memory engine DMA copy. /// </summary> /// <param name="state">Current class state</param> /// <param name="argument">Method call argument</param> public void LaunchDma(ref InlineToMemoryClassState state, int argument) { _isLinear = (argument & 1) != 0; _offset = 0; _size = (int)(BitUtils.AlignUp(state.LineLengthIn, 4) * state.LineCount); int count = _size / 4; if (_buffer == null || _buffer.Length < count) { _buffer = new int[count]; } ulong dstGpuVa = ((ulong)state.OffsetOutUpperValue << 32) | state.OffsetOut; _dstGpuVa = dstGpuVa; _dstX = state.SetDstOriginBytesXV; _dstY = state.SetDstOriginSamplesYV; _dstWidth = (int)state.SetDstWidth; _dstHeight = (int)state.SetDstHeight; _dstStride = (int)state.PitchOut; _dstGobBlocksInY = 1 << (int)state.SetDstBlockSizeHeight; _dstGobBlocksInZ = 1 << (int)state.SetDstBlockSizeDepth; _lineLengthIn = (int)state.LineLengthIn; _lineCount = (int)state.LineCount; _finished = false; }
/// <summary> /// Launches Inline-to-Memory engine DMA copy. /// </summary> /// <param name="state">Current class state</param> /// <param name="argument">Method call argument</param> public void LaunchDma(ref InlineToMemoryClassState state, int argument) { _isLinear = (argument & 1) != 0; _offset = 0; _size = (int)(state.LineLengthIn * state.LineCount); int count = BitUtils.DivRoundUp(_size, 4); if (_buffer == null || _buffer.Length < count) { _buffer = new int[count]; } ulong dstGpuVa = ((ulong)state.OffsetOutUpperValue << 32) | state.OffsetOut; ulong dstBaseAddress = _channel.MemoryManager.Translate(dstGpuVa); // Trigger read tracking, to flush any managed resources in the destination region. _channel.MemoryManager.Physical.GetSpan(dstBaseAddress, _size, true); _dstGpuVa = dstGpuVa; _dstX = state.SetDstOriginBytesXV; _dstY = state.SetDstOriginSamplesYV; _dstWidth = (int)state.SetDstWidth; _dstHeight = (int)state.SetDstHeight; _dstStride = (int)state.PitchOut; _dstGobBlocksInY = 1 << (int)state.SetDstBlockSizeHeight; _lineLengthIn = (int)state.LineLengthIn; _lineCount = (int)state.LineCount; _finished = false; }