コード例 #1
0
            public void SendFullRange()
            {
                uint num = (uint)((long)this.cpuData.Length * (long)((ulong)this.m_ElemStride));

                this.updateRanges[(int)this.m_UpdateRangesBatchStart] = new GfxUpdateBufferRange
                {
                    source = new UIntPtr(this.cpuData.GetUnsafeReadOnlyPtr <T>()),
                    offsetFromWriteStart = 0u,
                    size = num
                };
                Utility.GPUBuffer <T> expr_5F = this.gpuData;
                if (expr_5F != null)
                {
                    expr_5F.UpdateRanges(this.updateRanges.Slice((int)this.m_UpdateRangesBatchStart, 1), 0, (int)num);
                }
                this.ResetUpdateState();
            }
コード例 #2
0
            public void SendPartialRanges()
            {
                bool flag = this.m_UpdateRangesEnqueued == 0u;

                if (!flag)
                {
                    bool updateRangesSaturated = this.m_UpdateRangesSaturated;
                    if (updateRangesSaturated)
                    {
                        uint num = this.m_UpdateRangeMax - this.m_UpdateRangeMin;
                        this.m_UpdateRangesEnqueued = 1u;
                        this.updateRanges[(int)this.m_UpdateRangesBatchStart] = new GfxUpdateBufferRange
                        {
                            source = new UIntPtr(this.cpuData.Slice((int)this.m_UpdateRangeMin, (int)num).GetUnsafeReadOnlyPtr <T>()),
                            offsetFromWriteStart = this.m_UpdateRangeMin * this.m_ElemStride,
                            size = num * this.m_ElemStride
                        };
                    }
                    uint num2      = this.m_UpdateRangeMin * this.m_ElemStride;
                    uint rangesMax = this.m_UpdateRangeMax * this.m_ElemStride;
                    bool flag2     = num2 > 0u;
                    if (flag2)
                    {
                        for (uint num3 = 0u; num3 < this.m_UpdateRangesEnqueued; num3 += 1u)
                        {
                            int index = (int)(num3 + this.m_UpdateRangesBatchStart);
                            this.updateRanges[index] = new GfxUpdateBufferRange
                            {
                                source = this.updateRanges[index].source,
                                offsetFromWriteStart = this.updateRanges[index].offsetFromWriteStart - num2,
                                size = this.updateRanges[index].size
                            };
                        }
                    }
                    Utility.GPUBuffer <T> expr_15A = this.gpuData;
                    if (expr_15A != null)
                    {
                        expr_15A.UpdateRanges(this.updateRanges.Slice((int)this.m_UpdateRangesBatchStart, (int)this.m_UpdateRangesEnqueued), (int)num2, (int)rangesMax);
                    }
                    this.ResetUpdateState();
                }
            }