private unsafe SharpDX.Direct3D12.BlendStateDescription CreateBlendState(BlendStateDescription description)
        {
            var nativeDescription = new SharpDX.Direct3D12.BlendStateDescription();

            nativeDescription.AlphaToCoverageEnable  = description.AlphaToCoverageEnable;
            nativeDescription.IndependentBlendEnable = description.IndependentBlendEnable;

            var renderTargets = &description.RenderTarget0;

            for (int i = 0; i < 8; ++i)
            {
                ref var renderTarget       = ref renderTargets[i];
                ref var nativeRenderTarget = ref nativeDescription.RenderTarget[i];
        private unsafe SharpDX.Direct3D12.BlendStateDescription CreateBlendState(BlendStateDescription description)
        {
            var nativeDescription = new SharpDX.Direct3D12.BlendStateDescription();

            nativeDescription.AlphaToCoverageEnable  = description.AlphaToCoverageEnable;
            nativeDescription.IndependentBlendEnable = description.IndependentBlendEnable;

            var renderTargets = &description.RenderTarget0;

            for (int i = 0; i < 8; ++i)
            {
                nativeDescription.RenderTarget[i].IsBlendEnabled        = renderTargets[i].BlendEnable;
                nativeDescription.RenderTarget[i].SourceBlend           = (BlendOption)renderTargets[i].ColorSourceBlend;
                nativeDescription.RenderTarget[i].DestinationBlend      = (BlendOption)renderTargets[i].ColorDestinationBlend;
                nativeDescription.RenderTarget[i].BlendOperation        = (BlendOperation)renderTargets[i].ColorBlendFunction;
                nativeDescription.RenderTarget[i].SourceAlphaBlend      = (BlendOption)renderTargets[i].AlphaSourceBlend;
                nativeDescription.RenderTarget[i].DestinationAlphaBlend = (BlendOption)renderTargets[i].AlphaDestinationBlend;
                nativeDescription.RenderTarget[i].AlphaBlendOperation   = (BlendOperation)renderTargets[i].AlphaBlendFunction;
                nativeDescription.RenderTarget[i].RenderTargetWriteMask = (ColorWriteMaskFlags)renderTargets[i].ColorWriteChannels;
            }

            return(nativeDescription);
        }
        private unsafe SharpDX.Direct3D12.BlendStateDescription CreateBlendState(BlendStateDescription description)
        {
            var nativeDescription = new SharpDX.Direct3D12.BlendStateDescription();

            nativeDescription.AlphaToCoverageEnable = description.AlphaToCoverageEnable;
            nativeDescription.IndependentBlendEnable = description.IndependentBlendEnable;

            var renderTargets = &description.RenderTarget0;
            for (int i = 0; i < 8; ++i)
            {
                nativeDescription.RenderTarget[i].IsBlendEnabled = renderTargets[i].BlendEnable;
                nativeDescription.RenderTarget[i].SourceBlend = (BlendOption)renderTargets[i].ColorSourceBlend;
                nativeDescription.RenderTarget[i].DestinationBlend = (BlendOption)renderTargets[i].ColorDestinationBlend;
                nativeDescription.RenderTarget[i].BlendOperation = (BlendOperation)renderTargets[i].ColorBlendFunction;
                nativeDescription.RenderTarget[i].SourceAlphaBlend = (BlendOption)renderTargets[i].AlphaSourceBlend;
                nativeDescription.RenderTarget[i].DestinationAlphaBlend = (BlendOption)renderTargets[i].AlphaDestinationBlend;
                nativeDescription.RenderTarget[i].AlphaBlendOperation = (BlendOperation)renderTargets[i].AlphaBlendFunction;
                nativeDescription.RenderTarget[i].RenderTargetWriteMask = (ColorWriteMaskFlags)renderTargets[i].ColorWriteChannels;
            }

            return nativeDescription;
        }