Пример #1
0
        public override void BeginRender()
        {
            // Wait for the command buffer to be fully processed
            if (_fence.CompletedValue < _frameFenceValues[_frameIndex])
            {
                _fence.SetEventOnCompletion(_frameFenceValues[_frameIndex], _fenceEvent.SafeWaitHandle.DangerousGetHandle());
                _fenceEvent.WaitOne();
            }

            _commandAllocators[_frameIndex].Reset();
            _commands.Reset(_commandAllocators[_frameIndex], null);

            _device.SetCommandList(_commands.NativePointer, _fenceValue + 1);
        }