Exemplo n.º 1
0
        public ReadOnlySpan <byte> GetData(int layer, int level)
        {
            BackgroundResource resources = _gd.BackgroundResources.Get();

            if (_gd.CommandBufferPool.OwnedByCurrentThread)
            {
                _gd.FlushAllCommands();

                return(GetData(_gd.CommandBufferPool, resources.GetFlushBuffer(), layer, level));
            }
            else
            {
                return(GetData(resources.GetPool(), resources.GetFlushBuffer(), layer, level));
            }
        }
Exemplo n.º 2
0
        public unsafe ReadOnlySpan <byte> GetData(int offset, int size)
        {
            if (_map != IntPtr.Zero)
            {
                return(GetDataStorage(offset, size));
            }
            else
            {
                BackgroundResource resource = _gd.BackgroundResources.Get();

                if (_gd.CommandBufferPool.OwnedByCurrentThread)
                {
                    _gd.FlushAllCommands();

                    return(resource.GetFlushBuffer().GetBufferData(_gd.CommandBufferPool, this, offset, size));
                }
                else
                {
                    return(resource.GetFlushBuffer().GetBufferData(resource.GetPool(), this, offset, size));
                }
            }
        }