コード例 #1
0
        private void CreateStaging()
        {
            if (_staging == null)
            {
                D3D.BufferDescription desc = new D3D.BufferDescription();
                desc.BindFlags      = D3D.BindFlags.None;
                desc.CpuAccessFlags = D3D.CpuAccessFlags.Write | D3D.CpuAccessFlags.Read;
                desc.OptionFlags    = D3D.ResourceOptionFlags.None;
                desc.SizeInBytes    = base.IndexCount * ((base.IndexFormat == IndexFormat.SixteenBits) ? 2 : 4);
                desc.Usage          = D3D.ResourceUsage.Staging;
                _staging            = new D3D.Buffer(_graphicsDevice, desc);

                //Add to tracker
                _renderer.Resources.AddTrackedObject(_staging.ComPointer, this);
            }
        }
コード例 #2
0
        private void CreateStaging()
        {
            if (_staging == null)
            {
                D3D.BufferDescription desc = new D3D.BufferDescription();
                desc.BindFlags      = D3D.BindFlags.None;
                desc.CpuAccessFlags = D3D.CpuAccessFlags.Write | D3D.CpuAccessFlags.Read;
                desc.OptionFlags    = D3D.ResourceOptionFlags.None;
                desc.SizeInBytes    = base.VertexCount * base.VertexDeclaration.VertexStride;
                desc.Usage          = D3D.ResourceUsage.Staging;
                _staging            = new D3D.Buffer(_graphicsDevice, desc);

                //Add staging
                _renderer.Resources.AddTrackedObject(_staging.ComPointer, this);
            }
        }