Beispiel #1
0
        public void Close()
        {
            NativeCommandList.Close();

            // Recycle heaps
            ResetSrvHeap(false);
            ResetSamplerHeap(false);

            var fenceValue = GraphicsDevice.ExecuteCommandListInternal(NativeCommandList);

            GraphicsDevice.CommandAllocators.RecycleObject(fenceValue, nativeCommandAllocator);
            nativeCommandAllocator = null;
        }
        private void FlushInternal(bool wait)
        {
            var fenceValue = GraphicsDevice.ExecuteCommandListInternal(Close());

            if (wait)
            {
                GraphicsDevice.WaitForFenceInternal(fenceValue);
            }

            Reset();

            // Restore states
            if (boundPipelineState != null)
            {
                SetPipelineState(boundPipelineState);
            }
            currentCommandList.NativeCommandList.SetDescriptorHeaps(2, descriptorHeaps);
            SetRenderTargetsImpl(depthStencilBuffer, renderTargetCount, renderTargets);
        }
Beispiel #3
0
        private long FlushInternal(bool wait)
        {
            NativeCommandList.Close();

            var fenceValue = GraphicsDevice.ExecuteCommandListInternal(NativeCommandList);

            if (wait)
            {
                GraphicsDevice.WaitForFenceInternal(fenceValue);
            }

            NativeCommandList.Reset(nativeCommandAllocator, null);

            // Restore states
            if (boundPipelineState != null)
            {
                SetPipelineState(boundPipelineState);
            }
            NativeCommandList.SetDescriptorHeaps(2, descriptorHeaps);
            SetRenderTargetsImpl(depthStencilBuffer, renderTargetCount, renderTargets);

            return(fenceValue);
        }